add two new options '--repo' and '--ignore-ksrepo'
authorGui Chen <gui.chen@intel.com>
Thu, 13 Feb 2014 04:06:18 +0000 (23:06 -0500)
committerGui Chen <gui.chen@intel.com>
Tue, 4 Mar 2014 07:02:20 +0000 (02:02 -0500)
option '--repo' is to append a new repo to repo pool
option '--ignore-ksrepo' is to ignore repos in ks file

Change-Id: I10280f0c3f40b2f68186240f3694d2eb14104e10
Signed-off-by: Gui Chen <gui.chen@intel.com>
mic/conf.py
mic/creator.py

index 400829f..99b9696 100644 (file)
@@ -64,6 +64,8 @@ class ConfigMgr(object):
                     "repourl": {},
                     "localrepos": [],  # save localrepos
                     "runtime": "bootstrap",
+                    "repo": {},
+                    "ignore_ksrepo": False,
                 },
                 'chroot': {
                     "saveto": None,
index e27c8a1..01e9844 100644 (file)
@@ -123,6 +123,12 @@ class Creator(cmdln.Cmdln):
         optparser.add_option('', '--repourl', action='append',
                              dest='repourl', default=[],
                              help=SUPPRESS_HELP)
+        optparser.add_option('-R', '--repo', action='append',
+                             dest='repo', default=[],
+                             help=SUPPRESS_HELP)
+        optparser.add_option('', '--ignore-ksrepo', action='store_true',
+                             dest='ignore_ksrepo', default=False,
+                             help=SUPPRESS_HELP)
         return optparser
 
     def preoptparse(self, argv):
@@ -274,6 +280,11 @@ class Creator(cmdln.Cmdln):
                     continue
                 configmgr.create['repourl'][key] = val
 
+        if self.options.repo:
+            configmgr.create['repo'] = self.options.repo
+        if self.options.ignore_ksrepo:
+            configmgr.create['ignore_ksrepo'] = self.options.ignore_ksrepo
+
     def main(self, argv=None):
         if argv is None:
             argv = sys.argv