def list (self, verbose=False):
for i in self.pool_items: print(i.line())
def list (self, verbose=False):
for i in self.pool_items: print(i.line())
def _item (self, hostname):
for i in self.pool_items:
if i.hostname == hostname: return i
def _item (self, hostname):
for i in self.pool_items:
if i.hostname == hostname: return i
def retrieve_userdata (self, hostname):
return self._item(hostname).userdata
def retrieve_userdata (self, hostname):
return self._item(hostname).userdata
def __init__ (self, hostname):
Box.__init__(self, hostname)
self.build_instances = []
def __init__ (self, hostname):
Box.__init__(self, hostname)
self.build_instances = []
def add_build(self, buildname, pid):
for build in self.build_instances:
def add_build(self, buildname, pid):
for build in self.build_instances:
# inspect box and find currently running builds
def sense(self, options):
print('xb', end=' ')
# inspect box and find currently running builds
def sense(self, options):
print('xb', end=' ')
pids = self.backquote_ssh(['pgrep','lbuild'], trash_err=True)
if not pids: return
command = ['ps', '-o', 'pid,command'] + [ pid for pid in pids.split("\n") if pid]
pids = self.backquote_ssh(['pgrep','lbuild'], trash_err=True)
if not pids: return
command = ['ps', '-o', 'pid,command'] + [ pid for pid in pids.split("\n") if pid]
def set_timestamp (self,timestamp):
self.timestamp = timestamp
def set_timestamp (self,timestamp):
self.timestamp = timestamp
# to describe the currently running VM's
def sense(self, options):
print("xp", end=' ')
# to describe the currently running VM's
def sense(self, options):
print("xp", end=' ')
command = "rsync lxc-driver.sh {}:/root".format(self.hostname)
subprocess.getstatusoutput(command)
command = ['/root/lxc-driver.sh', '-c', 'sense_all']
lxc_stat = self.backquote_ssh (command)
for lxc_line in lxc_stat.split("\n"):
command = "rsync lxc-driver.sh {}:/root".format(self.hostname)
subprocess.getstatusoutput(command)
command = ['/root/lxc-driver.sh', '-c', 'sense_all']
lxc_stat = self.backquote_ssh (command)
for lxc_line in lxc_stat.split("\n"):
lxcname = lxc_line.split(";")[0]
pid = lxc_line.split(";")[1]
timestamp = lxc_line.split(";")[2]
lxcname = lxc_line.split(";")[0]
pid = lxc_line.split(";")[1]
timestamp = lxc_line.split(";")[2]
def set_buildname (self, buildname):
self.buildname = buildname
def set_buildname (self, buildname):
self.buildname = buildname
Box.__init__(self, hostname)
self.qemu_instances = []
self.max_qemus = max_qemus
Box.__init__(self, hostname)
self.qemu_instances = []
self.max_qemus = max_qemus
def add_node(self, nodename, pid):
for qemu in self.qemu_instances:
def add_node(self, nodename, pid):
for qemu in self.qemu_instances:
modules = self.backquote_ssh(['lsmod']).split('\n')
self._driver = '*NO kqemu/kvm_intel MODULE LOADED*'
for module in modules:
modules = self.backquote_ssh(['lsmod']).split('\n')
self._driver = '*NO kqemu/kvm_intel MODULE LOADED*'
for module in modules:
def set_timestamp(self, timestamp):
self.timestamp = timestamp
def set_timestamp(self, timestamp):
self.timestamp = timestamp
def reboot(self, options):
# can't reboot a vserver VM
def reboot(self, options):
# can't reboot a vserver VM
- self.starting_ips = [x for x in self.backquote_ssh(['cat',Starting.location], trash_err=True).strip().split('\n') if x]
+ self.starting_ips = [ x for x in self.backquote_ssh( ['cat', Starting.location], trash_err=True).strip().split('\n') if x ]
# scan timestamps on all tests
# this is likely to not invoke ssh so we need to be a bit smarter to get * expanded
# scan timestamps on all tests
# this is likely to not invoke ssh so we need to be a bit smarter to get * expanded
self.plc_boxes = self.plc_lxc_boxes
self.default_boxes = self.plc_boxes + self.qemu_boxes
self.all_boxes = self.build_boxes + [ self.test_box ] + self.plc_boxes + self.qemu_boxes
self.plc_boxes = self.plc_lxc_boxes
self.default_boxes = self.plc_boxes + self.qemu_boxes
self.all_boxes = self.build_boxes + [ self.test_box ] + self.plc_boxes + self.qemu_boxes
if self._sensed and not force:
return False
print('Sensing local substrate...', end=' ')
if self._sensed and not force:
return False
print('Sensing local substrate...', end=' ')