diff --git a/cpasswords/client.py b/cpasswords/client.py index 5bccfd0cb7f56eddccce70e642f639330868d57b..c615e830e7d13562228e78bc71170bae31d2e354 100755 --- a/cpasswords/client.py +++ b/cpasswords/client.py @@ -253,7 +253,8 @@ def put_password(options, roles, contents): success, enc_pwd_or_error = my_encrypt(options, roles, contents) if success: enc_pwd = enc_pwd_or_error - return put_files(options, [{'filename': options.filename, 'roles': roles, 'contents': enc_pwd}])[0] + put_files(options, [{'filename': options.filename, 'roles': roles, 'contents': enc_pwd}]) + return [True, ""] else: error = enc_pwd_or_error return [False, error] @@ -638,11 +639,7 @@ def recrypt_files(options, strict=False): if not options.quiet: print("Rechiffrement de %s" % (", ".join([f['filename'] for f in to_put]))) - results = put_files(options, to_put) - # On affiche les messages de retour - if not options.quiet: - for i in range(len(results)): - print("%s : %s" % (to_put[i]['filename'], results[i][1])) + put_files(options, to_put) else: log.warn(_("Aucun fichier n'a besoin d'être rechiffré")) diff --git a/cpasswords/remote.py b/cpasswords/remote.py index 580cd1fb2e5763687aded8c3caa5b65a9b1ad0d1..f3e1f209d17b05093e81645b43fdaa2cf0446140 100644 --- a/cpasswords/remote.py +++ b/cpasswords/remote.py @@ -65,6 +65,10 @@ def remote_command(options, command, arg=None, stdin_contents=None): stdin.write(json.dumps(stdin_contents)) stdin.flush() + # If the server is not expected to exit, then exit now + if stdin_contents: + return + # Return code == 0 if success ret = stdout.channel.recv_exit_status() if ret != 0: