+ def fsck_repair_node(self):
+ c = self.c
+ self.c.modules.sys.path.append("/tmp/source/")
+ self.c.modules.os.chdir('/tmp/source')
+ # TODO: restart
+ # TODO: set boot state to node's actually boot state.
+ # could be 'boot' or 'safeboot'
+ self.c.modules.os.chdir('/tmp/source')
+ if self.c.modules.os.path.exists('/tmp/BM_RUNNING'):
+ print "Running MANUAL FSCK already... try again soon."
+ else:
+ print "Running MANUAL fsck on %s" % self.node
+ cmd = "( touch /tmp/BM_RUNNING ; " + \
+ " fsck -v -f -y /dev/planetlab/root &> out.fsck ; " + \
+ " fsck -v -f -y /dev/planetlab/vserver >> out.fsck 2>&1 ; " + \
+ " python ./BootManager.py %s &> server.log < /dev/null ; " + \
+ " rm -f /tmp/BM_RUNNING " + \
+ ") &"
+ cmd = cmd % self.get_nodestate()
+ self.c.modules.os.system(cmd)
+ #self.restart_bootmanager('boot')
+ pass