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