def get_worker_ssh(self):
     local_ip = utils.get_host_ip()
     for node in self.conf_file.get_worker_ssh_data():
         if local_ip == node[0]:
             self.list_worker_ssh.append(None)
         else:
             ssh = utils.SSHConn(node[0],node[1],node[2],node[3])
             self.list_worker_ssh.append(ssh)
Exemple #2
0
    def __init__(self, node):
        try:
            self.api = LinstorAPI()
            self.sp = self.api.get_storagepool([node])
            self.res = self.api.get_resource([node])
        except AttributeError:
            self.sp = None
            self.res = None

        if node == utils.get_hostname():
            self.conn = None
        else:
            self.conn = utils.SSHConn(node)

        self.pv_list = self.get_pvs()
        self.vg_list = self.get_vgs()
        self.lv_list = self.get_lvs()
Exemple #3
0
 def get_ssh_conn(self):
     local_ip = utils.get_host_ip()
     vplx_configs = self.config.get_vplx_configs()
     username = "******"
     for vplx_config in vplx_configs:
         if "username" in vplx_config.keys():
             if vplx_config['username'] is not None:
                 username = vplx_config['username']
         if local_ip == vplx_config['public_ip']:
             self.list_vplx_ssh.append(None)
             utils.set_global_dict_value(None, vplx_config['public_ip'])
         else:
             ssh_conn = utils.SSHConn(vplx_config['public_ip'],
                                      vplx_config['port'], username,
                                      vplx_config['password'])
             self.list_vplx_ssh.append(ssh_conn)
             utils.set_global_dict_value(ssh_conn, vplx_config['public_ip'])
Exemple #4
0
 def __init__(self, node):
     if node == utils.get_hostname() or node is None:
         self.conn = None
     else:
         self.conn = utils.SSHConn(node)