summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuanhong Deng <dengyuanhong@chinamobile.com>2022-03-24 01:16:20 +0000
committerGerrit Code Review <gerrit@onap.org>2022-03-24 01:16:20 +0000
commit0e42adb3504e72671cda998e378b703c87c3504d (patch)
tree14f39afec6ce41dd1e8cc3034e8b112f8c4544b9
parentf993046d3cdf75f964586e48349733033da50114 (diff)
parent2128c5d0ca3211f293c1fa20a5768aa671ad9579 (diff)
Merge "update from python2 to python3"
-rw-r--r--mgr/mgr/pub/utils/restcall.py4
-rw-r--r--mgr/mgr/samples/views.py2
-rw-r--r--mgr/mgr/swagger/management/commands/export_swagger.py2
3 files changed, 5 insertions, 3 deletions
diff --git a/mgr/mgr/pub/utils/restcall.py b/mgr/mgr/pub/utils/restcall.py
index e37156d..8f29675 100644
--- a/mgr/mgr/pub/utils/restcall.py
+++ b/mgr/mgr/pub/utils/restcall.py
@@ -16,7 +16,9 @@ import base64
import sys
import traceback
import logging
-import urllib
+import urllib.request
+import urllib.parse
+import urllib.error
import uuid
import httplib2
diff --git a/mgr/mgr/samples/views.py b/mgr/mgr/samples/views.py
index 5a56260..ef71984 100644
--- a/mgr/mgr/samples/views.py
+++ b/mgr/mgr/samples/views.py
@@ -79,7 +79,7 @@ def stub(request, *args, **kwargs):
re_match = uri_re.match(request.path)
if not re_match:
continue
- for k, v in re_match.groupdict().items():
+ for k, v in list(re_match.groupdict().items()):
data = data.replace('<%s>' % k, v)
return Response(data=json.loads(data), status=code)
return Response(data={"stub": "stub"}, status=status.HTTP_200_OK)
diff --git a/mgr/mgr/swagger/management/commands/export_swagger.py b/mgr/mgr/swagger/management/commands/export_swagger.py
index e510189..63371f7 100644
--- a/mgr/mgr/swagger/management/commands/export_swagger.py
+++ b/mgr/mgr/swagger/management/commands/export_swagger.py
@@ -33,4 +33,4 @@ class Command(BaseCommand):
response = self.client.get("/api/vnfmgr/v1/swagger.json")
with open(options['name'], 'w') as swagger_file:
swagger_file.write(json.dumps(response.data))
- print("swagger api is written to %s" % options['name'])
+ print(("swagger api is written to %s" % options['name']))