Code Review
/
vfc
/
nfvo
/
lcm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Update python2 to python3
[vfc/nfvo/lcm.git]
/
lcm
/
pub
/
utils
/
restcall.py
diff --git
a/lcm/pub/utils/restcall.py
b/lcm/pub/utils/restcall.py
index
113910c
..
3cc6ed4
100644
(file)
--- a/
lcm/pub/utils/restcall.py
+++ b/
lcm/pub/utils/restcall.py
@@
-15,7
+15,9
@@
import sys
import traceback
import logging
import sys
import traceback
import logging
-import urllib2
+import urllib.request
+import urllib.error
+import urllib.parse
import uuid
import httplib2
import requests
import uuid
import httplib2
import requests
@@
-68,7
+70,7
@@
def call_req(base_url, user, passwd, auth_type, resource, method, content='', ad
ret = [1, "Unable to connect to %s" % full_url, resp_status, resp_Location]
continue
raise ex
ret = [1, "Unable to connect to %s" % full_url, resp_status, resp_Location]
continue
raise ex
- except urllib
2
.URLError as err:
+ except urllib
.error
.URLError as err:
ret = [2, str(err), resp_status, resp_Location]
except Exception as ex:
logger.error(traceback.format_exc())
ret = [2, str(err), resp_status, resp_Location]
except Exception as ex:
logger.error(traceback.format_exc())