# HG changeset patch # User Henry S. Thompson # Date 1641237971 0 # Node ID 900ff99ec749f71d8cea8aeb285bdd40b23fc5ae # Parent f13017bb450237badc2404126a9dfccad2a99f96 less noisy if success diff -r f13017bb4502 -r 900ff99ec749 newkey.py --- a/newkey.py Mon Jan 03 19:19:20 2022 +0000 +++ b/newkey.py Mon Jan 03 19:26:11 2022 +0000 @@ -12,15 +12,21 @@ import sys, os from socket import gethostname -from subprocess import run +from subprocess import run, PIPE hack=os.environ.copy() hack['SSH_AUTH_SOCK']='/home/ht/.gnupg/S.gpg-agent.ssh' def ssh_copy_id(keyfile,client): print(["ssh-copy-id","-i",keyfile,client],'...',sep='',end='') - res=run(["ssh-copy-id","-i",keyfile,client],env=hack).returncode - print('failed %s'%res if res else 'succeeded') + res=run(["ssh-copy-id","-i",keyfile,client],env=hack,text=True, + stdout=PIPE,stderr=PIPE) + if res.returncode: + print('failed %s'%res.returncode) + outs,errs=res.communicate() + print(errs) + else: + print('succeeded') ihost=None if sys.argv[1]=='-v':