From be8f001166e13a0a2400729ad314c62e95168dfd Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 22 Mar 2012 05:53:42 -0400 Subject: [PATCH] Refactoring step. --- ssh-installkeys | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 = {} -- 2.43.0