def _pe_status(self, pe_f): '''Return status as a string.''' self._setup_cib_env(pe_f) rc, s = cmd_status.crm_mon() if rc != 0: if s: common_err("crm_mon exited with code %d and said: %s" % (rc, s)) else: common_err("crm_mon exited with code %d" % rc) return None return s
def _pe_status_nohdr(self, pe_f): '''Return status (without header) as a string.''' self._setup_cib_env(pe_f) rc, s = cmd_status.crm_mon() if rc != 0: common_err("crm_mon exited with code %d and said: %s" % (rc, s)) return None l = s.split('\n') for i, ln in enumerate(l): if ln == "": break try: while l[i] == "": i += 1 except: pass return '\n'.join(l[i:])