Commit a864fab1 authored by József Gyürüsi's avatar József Gyürüsi
Browse files

[internal #1848537] Upgrade scripts to use Python3


      decode call moved to httpcall in DsRestAPI.py

Change-Id: Ic514df1438703c66cd9363c167d929abab076c7b
Signed-off-by: József Gyürüsi's avatarJózsef Gyürüsi <jozsef.gyurusi@ericsson.com>
parent 8fff593c
......@@ -36,7 +36,7 @@ class DsRestAPI:
req.add_header('Connection', 'close')
req.get_method = lambda: method
try:
return self._urlOpener.open(req).read()
return self._urlOpener.open(req).read().decode()
except Exception as e:
msg = 'Error connecting to server: ' + str(e)
proxyList = [name[0:-5] for name in dir(urllib.request.ProxyHandler()) if name.endswith('open')];
......@@ -166,11 +166,11 @@ def DsRestAPIPythonAPIMain(argv):
f = open(fileName, 'r')
request = json.load(f)
f.close()
print(api.getContentList(request).decode())
print(api.getContentList(request))
elif '-j' in argv:
jsonString = argv[argv.index('-j') + 1]
request = json.loads(jsonString)
print(api.getContentList(request).decode())
print(api.getContentList(request))
else:
requests = []
request = {}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment