summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuang Hao <hao.h.huang@intel.com>2013-03-06 12:06:07 +0800
committerGerrit Code Review <gerrit2@otctools.jf.intel.com>2013-03-11 23:16:23 -0700
commit869821ae7737e0a65c1d2613f87c425c988f417c (patch)
tree4a61e60b42cc166854620163ad70173a6fb724ee
parentae53de1666fd41891aa1aaa360ec0c614ad0a0fa (diff)
downloadmic-869821ae7737e0a65c1d2613f87c425c988f417c.tar.gz
mic-869821ae7737e0a65c1d2613f87c425c988f417c.tar.bz2
mic-869821ae7737e0a65c1d2613f87c425c988f417c.zip
Change default mutable arguments of Mic_RepoData.__init__.
Only pass arguments includepkgs, excludepkgs, baseurl, mirrorlist, name to super __init__ if they are not false. If they are not present the super __init__ will choose proper default values for those arguments. W0102: 26,4:Mic_RepoData.__init__: Dangerous default value [] as argument W0102: 26,4:Mic_RepoData.__init__: Dangerous default value [] as argument Change-Id: I56db875ee3d42213726a147a46f9d2e998025cce
-rw-r--r--mic/kickstart/custom_commands/micrepo.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/mic/kickstart/custom_commands/micrepo.py b/mic/kickstart/custom_commands/micrepo.py
index eed9a56..b31576e 100644
--- a/mic/kickstart/custom_commands/micrepo.py
+++ b/mic/kickstart/custom_commands/micrepo.py
@@ -23,14 +23,28 @@ from pykickstart.options import *
from pykickstart.commands.repo import *
class Mic_RepoData(F8_RepoData):
- def __init__(self, baseurl="", mirrorlist="", name="", priority=None,
- includepkgs=[], excludepkgs=[], save=False, proxy=None,
+
+ def __init__(self, baseurl="", mirrorlist=None, name="", priority=None,
+ includepkgs=(), excludepkgs=(), save=False, proxy=None,
proxy_username=None, proxy_password=None, debuginfo=False,
source=False, gpgkey=None, disable=False, ssl_verify="yes",
nocache=False):
- F8_RepoData.__init__(self, baseurl=baseurl, mirrorlist=mirrorlist,
- name=name, includepkgs=includepkgs,
- excludepkgs=excludepkgs)
+ kw = {}
+ # F8_RepoData keywords
+ if includepkgs:
+ kw['includepkgs'] = includepkgs
+ if excludepkgs:
+ kw['excludepkgs'] = excludepkgs
+
+ #FC6_RepoData keywords
+ if baseurl:
+ kw['baseurl'] = baseurl
+ if mirrorlist:
+ kw['mirrorlist'] = mirrorlist
+ if name:
+ kw['name'] = name
+
+ F8_RepoData.__init__(self, **kw)
self.save = save
self.proxy = proxy
self.proxy_username = proxy_username