- with open(self.verify_script, "r") as stdin_file:
- exit_status, stdout, stderr = self.connection.execute(
- self.shell_cmd,
- stdin=stdin_file)
- LOG.debug("action script of the operation is: {0}"
- .format(self.verify_script))
- LOG.debug("action parameter the of operation is: {0}"
- .format(self.shell_cmd))
+ if self.connection:
+ with open(self.verify_script, "r") as stdin_file:
+ exit_status, stdout, stderr = self.connection.execute(
+ "sudo {}".format(self.shell_cmd),
+ stdin=stdin_file)
+ else:
+ exit_status, stdout = \
+ execute_shell_command(
+ "/bin/bash {0} {1}".format(
+ self.verify_script,
+ self.rollback_param))
+
+ LOG.debug("action script of the operation is: %s",
+ self.verify_script)
+ LOG.debug("action parameter the of operation is: %s",
+ self.shell_cmd)