---
pykickstart/commands/repo.py | 29 +++++++++++++++++++++++++++++
pykickstart/handlers/f21.py | 4 ++--
pykickstart/handlers/rhel7.py | 4 ++--
tests/commands/repo.py | 10 ++++++++++
4 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/pykickstart/commands/repo.py b/pykickstart/commands/repo.py
index 6e0da76..3ee114c 100644
--- a/pykickstart/commands/repo.py
+++ b/pykickstart/commands/repo.py
@@ -132,6 +132,24 @@ RHEL6_RepoData = F14_RepoData
F15_RepoData = F14_RepoData
+class F21_RepoData(F14_RepoData):
+ removedKeywords = F14_RepoData.removedKeywords
+ removedAttrs = F14_RepoData.removedAttrs
+
+ def __init__(self, *args, **kwargs):
+ F14_RepoData.__init__(self, *args, **kwargs)
+ self.install = kwargs.get("install", False)
+
+ def _getArgsAsStr(self):
+ retval = F14_RepoData._getArgsAsStr(self)
+
+ if self.install:
+ retval += " --install"
+
+ return retval
+
+RHEL7_RepoData = F21_RepoData
+
class FC6_Repo(KickstartCommand):
removedKeywords = KickstartCommand.removedKeywords
removedAttrs = KickstartCommand.removedAttrs
@@ -252,3 +270,14 @@ class F15_Repo(F14_Repo):
removedAttrs = F14_Repo.removedAttrs
urlRequired = False
+
+class F21_Repo(F15_Repo):
+ removedKeywords = F15_Repo.removedKeywords
+ removedAttrs = F15_Repo.removedAttrs
+
+ def _getParser(self):
+ op = F15_Repo._getParser(self)
+ op.add_option("--install", action="store_true",
default=False)
+ return op
+
+RHEL7_Repo = F21_Repo
diff --git a/pykickstart/handlers/f21.py b/pykickstart/handlers/f21.py
index cac66bc..3f377da 100644
--- a/pykickstart/handlers/f21.py
+++ b/pykickstart/handlers/f21.py
@@ -69,7 +69,7 @@ class F21Handler(BaseHandler):
"raid": commands.raid.F20_Raid,
"realm": commands.realm.F19_Realm,
"reboot": commands.reboot.F18_Reboot,
- "repo": commands.repo.F15_Repo,
+ "repo": commands.repo.F21_Repo,
"rescue": commands.rescue.F10_Rescue,
"rootpw": commands.rootpw.F18_RootPw,
"selinux": commands.selinux.FC3_SELinux,
@@ -103,7 +103,7 @@ class F21Handler(BaseHandler):
"NetworkData": commands.network.F21_NetworkData,
"PartData": commands.partition.F18_PartData,
"RaidData": commands.raid.F18_RaidData,
- "RepoData": commands.repo.F15_RepoData,
+ "RepoData": commands.repo.F21_RepoData,
"SshPwData": commands.sshpw.F13_SshPwData,
"UserData": commands.user.F19_UserData,
"VolGroupData": commands.volgroup.F21_VolGroupData,
diff --git a/pykickstart/handlers/rhel7.py b/pykickstart/handlers/rhel7.py
index a128182..94609ac 100644
--- a/pykickstart/handlers/rhel7.py
+++ b/pykickstart/handlers/rhel7.py
@@ -68,7 +68,7 @@ class RHEL7Handler(BaseHandler):
"raid": commands.raid.F20_Raid,
"realm": commands.realm.F19_Realm,
"reboot": commands.reboot.F18_Reboot,
- "repo": commands.repo.F15_Repo,
+ "repo": commands.repo.RHEL7_Repo,
"rescue": commands.rescue.F10_Rescue,
"rootpw": commands.rootpw.F18_RootPw,
"selinux": commands.selinux.FC3_SELinux,
@@ -103,7 +103,7 @@ class RHEL7Handler(BaseHandler):
"NetworkData": commands.network.RHEL7_NetworkData,
"PartData": commands.partition.F18_PartData,
"RaidData": commands.raid.F18_RaidData,
- "RepoData": commands.repo.F15_RepoData,
+ "RepoData": commands.repo.RHEL7_RepoData,
"SshPwData": commands.sshpw.F13_SshPwData,
"UserData": commands.user.F19_UserData,
"VolGroupData": commands.volgroup.FC16_VolGroupData,
diff --git a/tests/commands/repo.py b/tests/commands/repo.py
index e03e7da..b944c54 100644
--- a/tests/commands/repo.py
+++ b/tests/commands/repo.py
@@ -118,5 +118,15 @@ class F15_TestCase(F14_TestCase):
def runTest(self, urlRequired=False):
F14_TestCase.runTest(self, urlRequired=urlRequired)
+class F21_TestCase(F15_TestCase):
+ def runTest(self, urlRequired=False):
+ F15_TestCase.runTest(self, urlRequired=urlRequired)
+ #pass
+ self.assert_parse("repo --name=blah --baseurl=https://www.domain.com
--install",
+ "repo --name=\"blah\"
--baseurl=https://www.domain.com --install\n")
+ #fail
+ self.assert_parse_error("repo --name=blah --baseurl=https://www.domain.com
--install=yeeeaah", KickstartParseError)
+
+
if __name__ == "__main__":
unittest.main()
--
1.9.3