Blame SOURCES/bz1862121-azure-events-3-decode-improvement.patch
|
|
e72037 |
--- a/heartbeat/azure-events.in 2020-08-03 16:55:42.336402080 +0200
|
|
|
e72037 |
+++ b/heartbeat/azure-events.in 2020-07-31 14:27:32.336656383 +0200
|
|
|
e72037 |
@@ -189,6 +189,8 @@
|
|
|
e72037 |
ocf.logger.debug("_exec: cmd = %s" % " ".join(command))
|
|
|
e72037 |
try:
|
|
|
e72037 |
ret = subprocess.check_output(command)
|
|
|
e72037 |
+ if type(ret) != str:
|
|
|
e72037 |
+ ret = ret.decode()
|
|
|
e72037 |
ocf.logger.debug("_exec: return = %s" % ret)
|
|
|
e72037 |
return ret.rstrip()
|
|
|
e72037 |
except Exception as err:
|
|
|
e72037 |
@@ -242,7 +244,7 @@
|
|
|
e72037 |
|
|
|
e72037 |
nodes = []
|
|
|
e72037 |
nodeList = clusterHelper._exec("crm_node", "--list")
|
|
|
e72037 |
- for n in nodeList.decode().split("\n"):
|
|
|
e72037 |
+ for n in nodeList.split("\n"):
|
|
|
e72037 |
nodes.append(n.split()[1])
|
|
|
e72037 |
ocf.logger.debug("getAllNodes: finished; return %s" % str(nodes))
|
|
|
e72037 |
|
|
|
e72037 |
@@ -313,7 +315,7 @@
|
|
|
e72037 |
ocf.logger.warning("transitionSummary: received unexpected transition summary: %s" % summary)
|
|
|
e72037 |
return False
|
|
|
e72037 |
summary = summary.split("Transition Summary:")[1]
|
|
|
e72037 |
- ret = summary.decode().split("\n").pop(0)
|
|
|
e72037 |
+ ret = summary.split("\n").pop(0)
|
|
|
e72037 |
|
|
|
e72037 |
ocf.logger.debug("transitionSummary: finished; return = %s" % str(ret))
|
|
|
e72037 |
return ret
|
|
|
e72037 |
@@ -334,7 +336,7 @@
|
|
|
e72037 |
if len(resources) == 0:
|
|
|
e72037 |
ret = []
|
|
|
e72037 |
else:
|
|
|
e72037 |
- ret = resources.decode().split("\n")
|
|
|
e72037 |
+ ret = resources.split("\n")
|
|
|
e72037 |
|
|
|
e72037 |
ocf.logger.debug("listOperationsOnNode: finished; return = %s" % str(ret))
|
|
|
e72037 |
return ret
|
|
|
e72037 |
@@ -480,7 +482,7 @@
|
|
|
e72037 |
|
|
|
e72037 |
eventIDStr = clusterHelper.getAttr(attr_pendingEventIDs, node=node)
|
|
|
e72037 |
if eventIDStr:
|
|
|
e72037 |
- eventIDs = eventIDStr.decode().split(",")
|
|
|
e72037 |
+ eventIDs = eventIDStr.split(",")
|
|
|
e72037 |
else:
|
|
|
e72037 |
eventIDs = None
|
|
|
e72037 |
|