def __init__(self, name, ipmiuser=None, ipmipass=None, ipmidomain=None, logfile=None, timeout=20): self.name = name self.shortname = remote.getShortName(name) self.timeout = timeout self.logfile = None self.ipmiuser = ipmiuser or config.ipmi_user self.ipmipass = ipmipass or config.ipmi_password self.ipmidomain = ipmidomain or config.ipmi_domain self.has_ipmi_credentials = all( [self.ipmiuser, self.ipmipass, self.ipmidomain] ) self.conserver_master = config.conserver_master self.conserver_port = config.conserver_port conserver_client_found = psutil.Popen( 'which console', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).wait() == 0 self.has_conserver = all([ config.use_conserver is not False, self.conserver_master, self.conserver_port, conserver_client_found, ])
def __init__(self, name, ipmiuser=None, ipmipass=None, ipmidomain=None, logfile=None, timeout=20): self.name = name self.shortname = remote.getShortName(name) self.timeout = timeout self.logfile = None self.ipmiuser = ipmiuser or config.ipmi_user self.ipmipass = ipmipass or config.ipmi_password self.ipmidomain = ipmidomain or config.ipmi_domain self.has_ipmi_credentials = all( [self.ipmiuser, self.ipmipass, self.ipmidomain]) self.conserver_master = config.conserver_master self.conserver_port = config.conserver_port conserver_client_found = subprocess.Popen( 'which console', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).wait() == 0 self.has_conserver = all([ config.use_conserver is not False, self.conserver_master, self.conserver_port, conserver_client_found, ])
def __init__(self, name, ipmiuser, ipmipass, ipmidomain, logfile=None, timeout=20): self.name = name self.shortname = remote.getShortName(name) self.timeout = timeout self.logfile = None self.ipmiuser = ipmiuser self.ipmipass = ipmipass self.ipmidomain = ipmidomain
def __init__(self, name): if libvirt is None: raise RuntimeError("libvirt not found") self.shortname = remote.getShortName(name) status_info = ls.get_status(self.shortname) try: if status_info.get('is_vm', False): phys_host = status_info['vm_host']['name'].split('.')[0] except TypeError: return self.connection = libvirt.open(phys_host) for i in self.connection.listDomainsID(): d = self.connection.lookupByID(i) if d.name() == self.shortname: self.vm_domain = d break return
def __init__(self, name): if libvirt is None: raise RuntimeError("libvirt not found") self.shortname = remote.getShortName(name) status_info = teuthology.lock.query.get_status(self.shortname) try: if teuthology.lock.query.is_vm(status=status_info): phys_host = status_info['vm_host']['name'].split('.')[0] except TypeError: raise RuntimeError("Cannot create a virtual console for %s", name) self.connection = libvirt.open(phys_host) for i in self.connection.listDomainsID(): d = self.connection.lookupByID(i) if d.name() == self.shortname: self.vm_domain = d break return