summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuanhuan Li <huanhuanx.li@intel.com>2014-07-14 10:45:12 +0800
committeradmin <yuhuan.yang@samsung.com>2016-02-04 18:19:59 +0800
commit725a53afed5c392b63451fa0ceb91e30325fd462 (patch)
tree527a65aa76610e0b8cb975dc8b471343c1bed607
parentd4694f05730aa0b322cfdcabf7a4f6092dbc8019 (diff)
downloadmic-725a53afed5c392b63451fa0ceb91e30325fd462.tar.gz
mic-725a53afed5c392b63451fa0ceb91e30325fd462.tar.bz2
mic-725a53afed5c392b63451fa0ceb91e30325fd462.zip
Enable ssl_veirify option in mic config file
There is an option 'ssl_veirfy=no' in mic.conf, but it is commented. Now enable this feature. Fixes: #2017 Change-Id: I92c98cfd7a399bed4d5e955681e857ea7990ad8d
-rw-r--r--mic/conf.py1
-rw-r--r--mic/imager/baseimager.py6
-rw-r--r--mic/kickstart/__init__.py4
-rw-r--r--mic/kickstart/custom_commands/micrepo.py2
4 files changed, 10 insertions, 3 deletions
diff --git a/mic/conf.py b/mic/conf.py
index b4aa235..9816245 100644
--- a/mic/conf.py
+++ b/mic/conf.py
@@ -65,6 +65,7 @@ class ConfigMgr(object):
"name_suffix": None,
"proxy": None,
"no_proxy": None,
+ "ssl_verify": "yes",
"copy_kernel": False,
"install_pkgs": None,
"check_pkgs": [],
diff --git a/mic/imager/baseimager.py b/mic/imager/baseimager.py
index 4e82571..10af5f9 100644
--- a/mic/imager/baseimager.py
+++ b/mic/imager/baseimager.py
@@ -988,6 +988,11 @@ class BaseImageCreator(object):
the kickstart to be overridden.
"""
+ def get_ssl_verify(ssl_verify=None):
+ if ssl_verify is not None:
+ return not ssl_verify.lower().strip() == 'no'
+ else:
+ return not self.ssl_verify.lower().strip() == 'no'
# initialize pkg list to install
if self.ks:
@@ -1019,6 +1024,7 @@ class BaseImageCreator(object):
source, gpgkey, disable, ssl_verify, nocache,
cost, priority) = repo
+ ssl_verify = get_ssl_verify(ssl_verify)
yr = pkg_manager.addRepository(name, baseurl, mirrorlist, proxy,
proxy_username, proxy_password, inc, exc, ssl_verify,
nocache, cost, priority)
diff --git a/mic/kickstart/__init__.py b/mic/kickstart/__init__.py
index 8116da3..a4b4f80 100644
--- a/mic/kickstart/__init__.py
+++ b/mic/kickstart/__init__.py
@@ -726,11 +726,11 @@ RepoType = collections.namedtuple("Repo",
def Repo(name, baseurl, mirrorlist=None, includepkgs=[], excludepkgs=[], proxy=None,
proxy_username=None, proxy_password=None, debuginfo=None,
- source=None, gpgkey=None, disable=None, ssl_verify=False,
+ source=None, gpgkey=None, disable=None, ssl_verify=None,
nocache=False, cost=None, priority=None):
return RepoType(name, baseurl, mirrorlist, includepkgs, excludepkgs, proxy,
proxy_username, proxy_password, debuginfo,
- source, gpgkey, disable, ssl_verify == "yes", nocache,
+ source, gpgkey, disable, ssl_verify, nocache,
cost, priority)
diff --git a/mic/kickstart/custom_commands/micrepo.py b/mic/kickstart/custom_commands/micrepo.py
index bfbc95d..b38ae77 100644
--- a/mic/kickstart/custom_commands/micrepo.py
+++ b/mic/kickstart/custom_commands/micrepo.py
@@ -69,5 +69,5 @@ class Mic_Repo(F14_Repo):
op.add_option("--gpgkey")
op.add_option("--priority", type="int")
- op.add_option("--ssl_verify", default="yes")
+ op.add_option("--ssl_verify", default=None)
return op