diff options
author | Rama-Huawei <rama.subba.reddy.s@huawei.com> | 2022-03-11 10:09:52 +0530 |
---|---|---|
committer | Rama-Huawei <rama.subba.reddy.s@huawei.com> | 2022-03-11 10:09:52 +0530 |
commit | 2128c5d0ca3211f293c1fa20a5768aa671ad9579 (patch) | |
tree | 10d3bade3cfdccb8fc2700fdf8b7aab8454bb821 | |
parent | 237ff06c840543d78c715cc488692bc6a3cfb7bc (diff) |
update from python2 to python3
Issue-ID: VFC-1915
Signed-off-by: Rama-Huawei <rama.subba.reddy.s@huawei.com>
Change-Id: I6646d146842681dc4b6ae1e239d68cc40d93e1a8
-rw-r--r-- | mgr/mgr/pub/utils/restcall.py | 4 | ||||
-rw-r--r-- | mgr/mgr/samples/views.py | 2 | ||||
-rw-r--r-- | mgr/mgr/swagger/management/commands/export_swagger.py | 2 |
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'])) |