def line(self):
return "Pooled {} ({}) -> {}".format(self.hostname, self.userdata, self.status)
def char (self):
if self.status == None: return '?'
def line(self):
return "Pooled {} ({}) -> {}".format(self.hostname, self.userdata, self.status)
def char (self):
if self.status == None: return '?'
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
self.substrate.add_starting_dummy(bname, vname)
print("After having loaded 'starting': IP pool")
print(self.line())
self.substrate.add_starting_dummy(bname, vname)
print("After having loaded 'starting': IP pool")
print(self.line())
ping_timeout_option = None
# returns True when a given hostname/ip responds to ping
def check_ping (self, hostname):
ping_timeout_option = None
# returns True when a given hostname/ip responds to ping
def check_ping (self, hostname):
if not Pool.ping_timeout_option:
(status, osname) = subprocess.getstatusoutput("uname -s")
if status != 0:
if not Pool.ping_timeout_option:
(status, osname) = subprocess.getstatusoutput("uname -s")
if status != 0:
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']
command = "rsync lxc-driver.sh {}:/root".format(self.hostname)
subprocess.getstatusoutput(command)
command = ['/root/lxc-driver.sh', '-c', 'sense_all']
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=' ')