self.recovery_script = self.get_script_fullpath(
self.fault_cfg['recovery_script'])
- if self.check():
- self.setup_done = True
+ self.data[self.service_name] = self.check()
def check(self):
with open(self.check_script, "r") as stdin_file:
stdin=stdin_file)
if stdout:
- LOG.info("check the envrioment success!")
- return True
+ LOG.info("check the environment success!")
+ return int(stdout.strip('\n'))
else:
LOG.error(
- "the host envrioment is error, stdout:%s, stderr:%s",
+ "the host environment is error, stdout:%s, stderr:%s",
stdout, stderr)
return False
exit_status, stdout, stderr = self.connection.execute(
"sudo /bin/bash -s {0} ".format(self.service_name),
stdin=stdin_file)
+ if exit_status:
+ LOG.info("Fail to restart service!")