Re: [PATCH pykickstart] Port bootloader --hvargs option from rhel 5.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks ok,

Regards,

Hans


On 11/19/2009 04:10 PM, Radek Vykydal wrote:
rhel5 bug #501438. This is only to be able to parse rhel5 kickstarts
using this option. It regards xen so I am not adding functionality
into anaconda and anaconda/booty.
---
  pykickstart/commands/bootloader.py |   24 ++++++++++++++++++++++++
  pykickstart/handlers/control.py    |    2 +-
  tests/commands/bootloader.py       |    8 ++++++++
  3 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/pykickstart/commands/bootloader.py b/pykickstart/commands/bootloader.py
index ce47060..d89b58d 100644
--- a/pykickstart/commands/bootloader.py
+++ b/pykickstart/commands/bootloader.py
@@ -180,3 +180,27 @@ class F12_Bootloader(F8_Bootloader):
          op = F8_Bootloader._getParser(self)
          op.add_option("--lba32", dest="forceLBA", deprecated=1, action="store_true")
          return op
+
+class F13_Bootloader(F12_Bootloader):
+    removedKeywords = F12_Bootloader.removedKeywords
+    removedAttrs = F12_Bootloader.removedAttrs
+
+    def __init__(self, writePriority=10, *args, **kwargs):
+        F12_Bootloader.__init__(self, writePriority, *args, **kwargs)
+
+        self.hvArgs = kwargs.get("hvArgs", "")
+
+    def _getArgsAsStr(self):
+        ret = F12_Bootloader._getArgsAsStr(self)
+
+        if self.hvArgs:
+            ret += " --hvargs=%s" %(self.hvArgs,)
+
+        return ret
+
+    def _getParser(self):
+        op = F12_Bootloader._getParser(self)
+        op.add_option("--hvargs", dest="hvArgs", type="string")
+        return op
+
+
diff --git a/pykickstart/handlers/control.py b/pykickstart/handlers/control.py
index e6f62c0..e15ef3b 100644
--- a/pykickstart/handlers/control.py
+++ b/pykickstart/handlers/control.py
@@ -594,7 +594,7 @@ commandMap = {
          "authconfig": authconfig.FC3_Authconfig,
          "autopart": autopart.F12_AutoPart,
          "autostep": autostep.FC3_AutoStep,
-        "bootloader": bootloader.F12_Bootloader,
+        "bootloader": bootloader.F13_Bootloader,
          "cdrom": method.F13_Method,
          "clearpart": clearpart.FC3_ClearPart,
          "cmdline": displaymode.FC3_DisplayMode,
diff --git a/tests/commands/bootloader.py b/tests/commands/bootloader.py
index 7eca1ad..601a2e2 100644
--- a/tests/commands/bootloader.py
+++ b/tests/commands/bootloader.py
@@ -100,5 +100,13 @@ class F12_TestCase(F8_TestCase):
          # deprecated
          self.assert_deprecated("bootloader", "--lba32")

+class F13_TestCase(F12_TestCase):
+    def runTest(self):
+        F12_TestCase.runTest(self)
+
+        self.assert_parse("bootloader --hvargs=bleh",
+                          "bootloader --hvargs=\"bleh\" --location=mbr\n")
+        self.assert_parse_error("bootloader --hvargs", KickstartParseError)
+
  if __name__ == "__main__":
      unittest.main()

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux