Enable ssl_veirify option in mic config file
authorHuanhuan Li <huanhuanx.li@intel.com>
Mon, 14 Jul 2014 02:45:12 +0000 (10:45 +0800)
committeradmin <yuhuan.yang@samsung.com>
Thu, 4 Feb 2016 10:19:59 +0000 (18:19 +0800)
There is an option 'ssl_veirfy=no' in mic.conf, but it is commented. Now enable
this feature.

Fixes: #2017
Change-Id: I92c98cfd7a399bed4d5e955681e857ea7990ad8d

mic/conf.py
mic/imager/baseimager.py
mic/kickstart/__init__.py
mic/kickstart/custom_commands/micrepo.py

index b4aa2355e43a8329d20fe33d9fbf6137fdf27a68..9816245b6c2e78e2f42515fde40dfe41e2fb6012 100644 (file)
@@ -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": [],
index 4e8257184055ed920631a647f425bf1b0f5286af..10af5f963db9190fba9d2d06415d670aa969fbb6 100644 (file)
@@ -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)
index 8116da31e30492458fb8dd1ae0b46c1a175abcea..a4b4f80307402dc6578c6791d867fe5f99b17bbb 100644 (file)
@@ -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)
 
 
index bfbc95d866652e82eb01d746605b6d4208312f12..b38ae77174789c0742cbb7fb74da569b5b0a4301 100644 (file)
@@ -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