def CheckSupportStatus(self, support_log_path): #{ if (None != self.status): #{ return #} end if DebugMsg(self, "Checking support status...") tail_cmd = "tail -n1 %s" % support_log_path output = CleanLine(RunCommandFromString(tail_cmd, stdout=STRING_OUT, dpt=self.options.dpt)[0]) #DebugMsg(self, "STATUS: \"%s\"" % output) if ("complete" == output.lower()): #{ self.status = "complete" else: self.status = "in progress"
def GetCommandPath(self, template_line): #{ cmd_name = template_line.split("=")[0] which_cmd = "which %s" % cmd_name if (cmd_name.endswith("_cluster")): #{ which_cmd = "ssh %s \"%s\"" % (self.options.cluster_head, which_cmd.replace("_cluster","")) #} end if response = "N" cmd_path = CleanLine(RunCommandFromString(which_cmd, stdout=STRING_OUT)[0]) if ("no %s in" % cmd_name.replace("_cluster","") in cmd_path): #{ LogMsg(self, " Could not find %s binary with \"which\":\n %s" % (cmd_name, cmd_path)) else: if (cmd_path.startswith("alias")): #{ cmd_path = cmd_path.split()[-1] #} end if #LogMsg(self, " Found %s binary at %s. Is this the correct path " # "(y/n)? " % (cmd_name, cmd_path), newline=False) # get user input (convert to upper-case first character) response = GetYesOrNoInput(self, " Found %s binary at %s. Is this " "the correct path (y/n)? " % (cmd_name, cmd_path)) #LogMsg(self, response, write_to_screen=False) #} end if while ("N" == response): #{ #LogMsg(self, " Please enter the correct path for the %s binary: " % # cmd_name, newline=False) cmd_path = GetStringInput(self, " Please enter the correct path " "for the %s binary: " % cmd_name).split(";")[0] #LogMsg(self, cmd_path, write_to_screen=False) if (not os.path.isfile(cmd_path)): #{ #LogMsg(self, " There is no file at %s. Is this the correct path " # "(y/n)? " % (cmd_path), newline=False) # get user input (convert to upper-case first character) response = GetYesOrNoInput(self, " There is no file at %s. Is " "this the correct path (y/n)? " % (cmd_path)) #LogMsg(self, response, write_to_screen=False) else: response = "Y" #} end if #} end if return "%s=%s" % (cmd_name, cmd_path)