diff options
Diffstat (limited to 'res')
-rw-r--r-- | res/res/pub/utils/restcall.py | 4 | ||||
-rw-r--r-- | res/res/swagger/management/commands/export_swagger.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/res/res/pub/utils/restcall.py b/res/res/pub/utils/restcall.py index 60b9f76..852bf0b 100644 --- a/res/res/pub/utils/restcall.py +++ b/res/res/pub/utils/restcall.py @@ -15,7 +15,7 @@ import sys import traceback import logging -import urllib2 +import urllib import uuid import httplib2 @@ -60,7 +60,7 @@ def call_req(base_url, user, passwd, auth_type, resource, method, content=''): ret = [1, "Unable to connect to %s" % full_url, resp_status] continue raise ex - except urllib2.URLError as err: + except urllib.error.URLError as err: ret = [2, str(err), resp_status] except Exception as ex: logger.error(traceback.format_exc()) diff --git a/res/res/swagger/management/commands/export_swagger.py b/res/res/swagger/management/commands/export_swagger.py index 8b5274a..930537c 100644 --- a/res/res/swagger/management/commands/export_swagger.py +++ b/res/res/swagger/management/commands/export_swagger.py @@ -33,4 +33,4 @@ class Command(BaseCommand): response = self.client.get("/api/vnfres/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']) |