From c18c35a074e32b57d942220fbd75368650641933 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 22 Nov 2002 11:40:46 +0000 Subject: [PATCH] Note when a file exists. --- ssh-installkeys | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 - -- 2.43.0