From: Huanhuan Li Date: Mon, 14 Jul 2014 02:45:12 +0000 (+0800) Subject: Enable ssl_veirify option in mic config file X-Git-Tag: 0.26~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=74a1c44ca8e2bd4e191bdba8b197133dfb93346d;p=tools%2Fmic.git 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 --- 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