def get_cluster_status_text( runner: CommandRunner, hide_inactive_resources: bool, verbose: bool, ) -> Tuple[str, List[str]]: cmd = [__exec("crm_mon"), "--one-shot"] if not hide_inactive_resources: cmd.append("--inactive") if verbose: cmd.extend(["--show-detail", "--show-node-attributes", "--failcounts"]) # by default, pending and failed actions are displayed # with verbose==True, we display the whole history if is_fence_history_supported_status(runner): cmd.append("--fence-history=3") stdout, stderr, retval = runner.run(cmd) if retval != 0: raise CrmMonErrorException( reports.cluster_state_cannot_load(join_multilines([stderr, stdout]))) warnings: List[str] = [] if stderr.strip(): warnings = [ line for line in stderr.strip().splitlines() if verbose or not line.startswith("DEBUG: ") ] return stdout.strip(), warnings
def get_cluster_status_xml(runner): stdout, stderr, retval = runner.run( [__exec("crm_mon"), "--one-shot", "--as-xml", "--inactive"]) if retval != 0: raise CrmMonErrorException( reports.cluster_state_cannot_load(join_multilines([stderr, stdout]))) return stdout
def get_cluster_status_xml(runner): output, retval = runner.run( [__exec("crm_mon"), "--one-shot", "--as-xml", "--inactive"] ) if retval != 0: raise CrmMonErrorException( reports.cluster_state_cannot_load(retval, output) ) return output
def get_cluster_status_xml(runner): stdout, stderr, retval = runner.run( [__exec("crm_mon"), "--one-shot", "--as-xml", "--inactive"] ) if retval != 0: raise CrmMonErrorException( reports.cluster_state_cannot_load(join_multilines([stderr, stdout])) ) return stdout