]> thyrsus.com Git - ssh-installkeys.git/commitdiff
Refactoring step.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 22 Mar 2012 09:53:42 +0000 (05:53 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 22 Mar 2012 09:53:42 +0000 (05:53 -0400)
ssh-installkeys

index ee89a4aa7e7916d007aab12fa62ce354d0c3f05a..bb5c047896cffd7e313e577bb4e9e968489f2ca6 100755 (executable)
@@ -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 = {}