fence-agents/bz1696584-fence_gce-fix-python3-encoding-issue.patch

23 lines
886 B
Diff
Raw Normal View History

From 64ac6207152508392690b7c1dfcac3fe0a76adfd Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Fri, 5 Apr 2019 09:48:52 +0200
Subject: [PATCH] fence_gce: fix Python 3 encoding issue
---
agents/gce/fence_gce.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/agents/gce/fence_gce.py b/agents/gce/fence_gce.py
index 93cd11801..b171710d9 100644
--- a/agents/gce/fence_gce.py
+++ b/agents/gce/fence_gce.py
@@ -146,7 +146,7 @@ def get_metadata(metadata_key, params=None, timeout=None):
url = '%s?%s' % (metadata_url, params)
request = urlrequest.Request(url, headers=METADATA_HEADERS)
request_opener = urlrequest.build_opener(urlrequest.ProxyHandler({}))
- return request_opener.open(request, timeout=timeout * 1.1).read()
+ return request_opener.open(request, timeout=timeout * 1.1).read().decode("utf-8")
def define_new_opts():