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 = {}