From efaa2fb38bcb3965ccc3f51de3514c0ed99176cc Mon Sep 17 00:00:00 2001
From: Patrick
Date: Fri, 28 Jun 2019 17:45:33 +0200
Subject: [PATCH] Make scripts compatible with Python3.5
---
ask_for_jobs | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/ask_for_jobs b/ask_for_jobs
index 6135afbb..5d417933 100755
--- a/ask_for_jobs
+++ b/ask_for_jobs
@@ -20,8 +20,8 @@ IMAGES = {
def manage_jobs(service):
# Get queued jobs
- queued = json.load(
- urllib.request.urlopen(VRE_MANAGER + "?service=" + service + "&status=queued")
+ queued = json.loads(
+ urllib.request.urlopen(VRE_MANAGER + "?service=" + service + "&status=queued").read().decode('utf-8')
)
# Return if no jobs are available
@@ -31,7 +31,6 @@ def manage_jobs(service):
# Get a list of compute nodes
compute_nodes = subprocess.run(
["docker", "ps", "--filter", "ancestor=" + IMAGES[service], "--format", "{{.Names}}"],
- encoding="utf-8",
stdout=subprocess.PIPE
).stdout.split()