Update python2 to python3
[vfc/nfvo/driver/vnfm/svnfm.git] / zte / vmanager / driver / pub / utils / restcall.py
index fd0b3dd..6b2c4b0 100644 (file)
@@ -15,7 +15,7 @@
 import logging
 import sys
 import traceback
-import urllib2
+import urllib.error
 import uuid
 
 import httplib2
@@ -61,7 +61,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())