summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McCallister <mike@mccllstr.com>2011-10-15 16:21:01 -0500
committerMike McCallister <mike@mccllstr.com>2011-10-15 16:21:01 -0500
commit17a031da6ec2ee448ee3d8e18dde5c6a3785c464 (patch)
tree35aa9ffff9d5b0d80e85954ffba8d5cdbca5f1cf
parent698d573e18a7d979f97964681212223babe5adf1 (diff)
downloadbcfg2-17a031da6ec2ee448ee3d8e18dde5c6a3785c464.tar.gz
bcfg2-17a031da6ec2ee448ee3d8e18dde5c6a3785c464.tar.bz2
bcfg2-17a031da6ec2ee448ee3d8e18dde5c6a3785c464.zip
Use urlopen from urllib2 instead of urllib so that HTTP errors will be caught.
When using urllib.urlopen, no exception is thrown when the URL request receives a 403 error, for example.
-rw-r--r--src/lib/Bcfg2Py3k.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/Bcfg2Py3k.py b/src/lib/Bcfg2Py3k.py
index 606379d1f..4803bf8b2 100644
--- a/src/lib/Bcfg2Py3k.py
+++ b/src/lib/Bcfg2Py3k.py
@@ -12,7 +12,7 @@ try:
from urllib2 import HTTPPasswordMgrWithDefaultRealm
from urllib2 import build_opener
from urllib2 import install_opener
- from urllib import urlopen
+ from urllib2 import urlopen
from urllib2 import HTTPError
except ImportError:
from urllib.parse import urljoin, urlparse