summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Qiang <qiang.z.zhang@intel.com>2011-10-26 11:15:11 +0800
committerZhang Qiang <qiang.z.zhang@intel.com>2011-10-26 11:15:11 +0800
commit05438af41544c3908ab691b9ed1c465a08219a89 (patch)
tree02bbfb6c0bebaa05ea3b5a5359ec6d90f11847a9
parentd260dcf04855146920308a28779413fbbb140e8e (diff)
downloadmic-05438af41544c3908ab691b9ed1c465a08219a89.tar.gz
mic-05438af41544c3908ab691b9ed1c465a08219a89.tar.bz2
mic-05438af41544c3908ab691b9ed1c465a08219a89.zip
backport:Catch httplib.HTTPException for urllib2.urlopen
Catch httplib.HTTPException for urllib2.urlopen Note: fix bug #18144 backport from: d1b0ca1c15c68b73c5af1d3a83c122952189f799
-rw-r--r--mic/utils/rpmmisc.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/mic/utils/rpmmisc.py b/mic/utils/rpmmisc.py
index 1744fce..7e524bf 100644
--- a/mic/utils/rpmmisc.py
+++ b/mic/utils/rpmmisc.py
@@ -418,6 +418,7 @@ def checkRepositoryEULA(name, repo):
import shutil
import urlparse
import urllib2 as u2
+ import httplib
from errors import CreatorError
def _check_and_download_url(u2opener, url, savepath):
@@ -443,6 +444,8 @@ def checkRepositoryEULA(name, repo):
raise CreatorError(oserr)
except u2.URLError, err:
raise CreatorError(err)
+ except httplib.HTTPException, e:
+ raise CreatorError(e)
# save to file
licf = open(savepath, "w")