diff options
Diffstat (limited to 'examples/python/dbus/update-secrets.py')
-rwxr-xr-x | examples/python/dbus/update-secrets.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/python/dbus/update-secrets.py b/examples/python/dbus/update-secrets.py index 13cac1b08c..3a51446bd7 100755 --- a/examples/python/dbus/update-secrets.py +++ b/examples/python/dbus/update-secrets.py @@ -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, e: + except Exception as 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, e: + except Exception as e: pass # Find connection by the id @@ -101,7 +101,7 @@ 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 |