From: Eric S. Raymond Date: Thu, 22 Mar 2012 09:53:42 +0000 (-0400) Subject: Refactoring step. X-Git-Tag: 1.7~8 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=be8f001166e13a0a2400729ad314c62e95168dfd;p=ssh-installkeys.git Refactoring step. --- diff --git a/ssh-installkeys b/ssh-installkeys index ee89a4a..bb5c047 100755 --- a/ssh-installkeys +++ b/ssh-installkeys @@ -632,11 +632,14 @@ class ssh_session: class KeyConfig(ConfigParser.RawConfigParser): "Store our state about remote keys." + @staticmethod + def configfile(): + return os.path.expanduser('~/.ssh-installkeys') def __init__(self): ConfigParser.RawConfigParser.__init__(self) - self.read(os.path.expanduser('~/.ssh-installkeys')) + self.read(KeyConfig.configfile()) def save(self): - self.write(open(os.path.expanduser('~/.ssh-installkeys'), "w")) + self.write(open(KeyConfig.configfile(), "w")) def readremote(self, session): authorized = session.ssh("cat ~/.ssh/authorized_keys") keydict = {}