Esempio n. 1
0
 def run(self):
     parser = config_parser()
     if self._default is True:
         username,password,port = self._load_default_login_opts()
     else:
         server_info = parser.get_record(self._ip)
         username = server_info['user']
         password = server_info['password']
         port = server_info['port']
     os.system("general %s %s %s \"%s\""%(self._ip, port, username, password))
Esempio n. 2
0
 def run(self):
     config = config_parser()
     for i in config:
         print(i['ip'])
Esempio n. 3
0
 def run(self):
     config = config_parser()
     config.add_record(self.__ip__, self.__port__, self.__user__,
                       self.__password__)
Esempio n. 4
0
 def run(self):
     parser = config_parser()
     server_info = parser.get_record(self.__ip__)
     os.system("general %s %s %s \"%s\"" %
               (server_info['ip'], server_info['port'], server_info['user'],
                server_info['password']))
Esempio n. 5
0
 def __init__(self):
     # 创建帮助信息
     self._usage_helper = usage_helper(sys.argv[0], "sshcmd",
                                       self._parameters)
     self._config = config_parser()
Esempio n. 6
0
File: del.py Progetto: caostorm/smng
 def run(self):
     config = config_parser()
     config.remove_record(self._ip)
     pass