From: Eric S. Raymond Date: Fri, 22 Nov 2002 11:40:46 +0000 (+0000) Subject: Note when a file exists. X-Git-Tag: 1-1~11 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=c18c35a074e32b57d942220fbd75368650641933;p=ssh-installkeys.git Note when a file exists. --- diff --git a/ssh-installkeys b/ssh-installkeys index ed745ec..f07cac8 100755 --- a/ssh-installkeys +++ b/ssh-installkeys @@ -46,8 +46,8 @@ License: Python Software Foundation License Noah Spurrier -$Revision: 1.4 $ -$Date: 2002/11/22 11:33:08 $ +$Revision: 1.5 $ +$Date: 2002/11/22 11:35:37 $ """ import os, sys import select @@ -68,7 +68,7 @@ A critical module was not found. Probably this OS does not support it. Currently pexpect is intended for UNIX operating systems (including OS-X).""" __version__ = '0.94' -__revision__ = '$Revision: 1.4 $' +__revision__ = '$Revision: 1.5 $' __all__ = ['ExceptionPexpect', 'EOF', 'TIMEOUT', 'spawn', '__version__', '__revision__'] @@ -728,7 +728,7 @@ class ssh_session: print "Correcting permissions..." session.remote("/bin/chmod u+r,g-w,o-w %s" % file) def forcefile(self, file, command): - "Create file with command idf it does not already exist." + "Create file with command if it does not already exist." perms = session.checkfile(file) if perms is None: print "Remote %s doesn't exist." % file @@ -738,6 +738,8 @@ class ssh_session: print "Creating remote %s" % file session.remote(command) perms = session.checkfile(file) + else: + print file, "already exists." return perms if __name__ == '__main__': @@ -831,4 +833,3 @@ if __name__ == '__main__': print "Done." # End -