From ee9c73a923909e23a649407be77e25235d769e25 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Fri, 11 May 2018 22:08:45 +0200 Subject: New upstream version 1.10.8 --- examples/python/dbus/update-secrets.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'examples/python/dbus/update-secrets.py') diff --git a/examples/python/dbus/update-secrets.py b/examples/python/dbus/update-secrets.py index 1fc73209..13cac1b0 100755 --- a/examples/python/dbus/update-secrets.py +++ b/examples/python/dbus/update-secrets.py @@ -22,7 +22,7 @@ # Update() method. The method replaces all previous settings with new ones # including possible secrets. # So, we get all settings using GetSettings() and then find out what secrets -# are associated with the connection using GetSecrets(), ask for new secret +# are associated with the connection using GetSecrets(), ask for new secret # values, and add them to the settings that we pass to Update(). # @@ -37,16 +37,16 @@ def change_secrets_in_one_setting(proxy, config, setting_name): # returns a dict of dicts mapping name::setting, where setting is a dict # mapping key::value. Each member of the 'setting' dict is a secret secrets = proxy.GetSecrets(setting_name) - print("Current secrets:" + secrets) + print "Current secrets:", secrets # Ask user for new secrets and put them into our connection config for setting in secrets: for key in secrets[setting]: new_secret = raw_input ("Enter new secret for '%s' in '%s': " % (key, setting)) config[setting_name][key] = new_secret - except Exception as e: + except Exception, e: #code = str(e).split(':')[0] - #print("Exception:" + str(e)) + #print "Exception:", str(e) pass def change_secrets(con_path, config): @@ -76,7 +76,7 @@ def find_connection(name): connection = dbus.Interface(con_proxy, "org.freedesktop.NetworkManager.Settings.Connection") try: config = connection.GetSettings() - except Exception as e: + except Exception, e: pass # Find connection by the id @@ -101,10 +101,10 @@ if len(sys.argv) != 2: # Find the connection con = find_connection(sys.argv[1]) -print("Connection found: " + con_path) +print "Connection found: ", con_path if con: - # Obtain new secrets and put then into connection dict + # Obtain new secrets and put then into connection dict change_secrets(con_path, con) # Change the connection with Update() -- cgit 1.3.0-6-gf8a5