# everything in the onelab.eu domain
domain = 'onelab.eu'
testmaster = 'testmaster'
- build_boxes = \
- [ "mirror" ] + \
- [ "build%d"%i for i in range (1,4) ]
+ build_boxes = [ "mirror", "liquid", "reed", "velvet", ]
plc_boxes = [ "testplc" ]
qemu_boxes = \
[ "testqemu%d"%i for i in range (1,4) ] + \
self.run(command,"Cleaning up trackers on %s"%box)
def handle_build_box (self,box):
- if self.options.probe:
+ if not self.options.probe:
+ self.reboot(box)
+ else:
command=['ssh',self.root(box),'pgrep','build']
if self.options.dry_run:
self.run(command,None)
else:
command=['ssh',self.root(box),'ps'] + [ pid for pid in pids.split("\n") if pid]
self.run(command,"Active build processes on %s"%box)
- else:
- self.reboot(box)
vplc_matcher = re.compile(".*(vplc[0-9]+$)")
def vplcname (self, vservername):
else: return ""
def handle_plc_box (self,box):
- if self.options.probe:
+ if not self.options.probe:
+ self.reboot(box)
+ else:
command=['ssh',self.root(box),'vserver-stat']
if self.options.dry_run:
self.run(command,"Active vservers on %s"%box)
except:
self.run(command,"Fine-grained method failed - fallback to plain vserver-stat")
- else:
- self.reboot(box)
+ vnode_matcher = re.compile(".*(vnode[0-9]+)")
+ def vnodename (self, ps_line):
+ match = self.vnode_matcher.match(ps_line)
+ if match: return match.groups(0)
+ else: return ""
+
def handle_qemu_box (self,box):
- if self.options.probe:
+ if not self.options.probe:
+ self.reboot(box)
+ else:
command=['ssh',self.root(box),'pgrep','qemu']
if self.options.dry_run:
self.run(command,None)
if not pids:
self.header ('No qemu process on %s'%box)
else:
+ self.header ("Active qemu processes on %s"%box)
command=['ssh',self.root(box),'ps'] + [ pid for pid in pids.split("\n") if pid]
- self.run(command,"Active qemu processes on %s"%box)
- else:
- self.reboot(box)
+ ps_lines = self.backquote (command).split("\n")
+ for ps_line in ps_lines:
+ if not ps_line or ps_line.find('PID') >=0 : continue
+ node=self.vnodename(ps_line)
+ if node: print "== %s =="%node
+ print ps_line
def handle_box(self,box):
if box in self.qemu_boxes: