diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2013-07-25 14:22:22 +0200 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2013-07-25 14:22:22 +0200 |
commit | aa1fd4dc9256b63e74f930e81cd755b8c58a716b (patch) | |
tree | 7e5d2c2e6dd98222c480bd2b07a04fee722434f7 | |
parent | 83a28f02d1f0a5549bf7361548451df555d0f1f2 (diff) |
util: don't try and save a non-existent password
-rw-r--r-- | src/util.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/util.py b/src/util.py index ae88084..91d1755 100644 --- a/src/util.py +++ b/src/util.py @@ -95,13 +95,14 @@ def scrub_env(): def got_account_cb (o, r, password, func): account = o.create_account_finish (r) # Put the password in our credentials store - try: - os.makedirs (os.path.join (GLib.get_user_config_dir (), "phoenix")) - except: - pass - authfile = os.path.join (GLib.get_user_config_dir (), "phoenix", "auth") - f = open (authfile, "a+") - f.write (account.get_path_suffix() + " " + password + "\n") + if password: + try: + os.makedirs (os.path.join (GLib.get_user_config_dir (), "phoenix")) + except: + pass + authfile = os.path.join (GLib.get_user_config_dir (), "phoenix", "auth") + f = open (authfile, "a+") + f.write (account.get_path_suffix() + " " + password + "\n") func(account) |