FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 11-19-2009, 02:10 PM
Radek Vykydal
 
Default Port bootloader --hvargs option from rhel 5.

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
")
+ self.assert_parse_error("bootloader --hvargs", KickstartParseError)
+
if __name__ == "__main__":
unittest.main()
--
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 11-19-2009, 03:24 PM
Hans de Goede
 
Default Port bootloader --hvargs option from rhel 5.

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
")
+ self.assert_parse_error("bootloader --hvargs", KickstartParseError)
+
if __name__ == "__main__":
unittest.main()


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 11-19-2009, 05:11 PM
Jeremy Katz
 
Default Port bootloader --hvargs option from rhel 5.

On Thu, Nov 19, 2009 at 10:10 AM, Radek Vykydal <rvykydal@redhat.com> 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.

Is it worth it to spit out the deprecated option warning with --hvargs?

- Jeremy

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 11-19-2009, 09:08 PM
Chris Lumens
 
Default Port bootloader --hvargs option from rhel 5.

> 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.

Since this option is only supported on the RHEL5 tree, not any Fedora
tree, what you should instead do is create a new RHEL5_Bootloader class
that derives from FC4_Bootloader and add the option onto that.

Otherwise, you're on the right track. Thank you for adding a test case
as well.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 11-20-2009, 09:06 AM
Radek Vykydal
 
Default Port bootloader --hvargs option from rhel 5.

Chris Lumens 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.



Since this option is only supported on the RHEL5 tree, not any Fedora
tree, what you should instead do is create a new RHEL5_Bootloader class
that derives from FC4_Bootloader and add the option onto that.



Ah, I think I understand it now - and if we wanted to be able parse (not
to crash on)
--hvargs in rhel6, we would add it to RHEL6_Bootloader derived from
something

like F12_Bootloader, right?

Radek

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 11-20-2009, 01:31 PM
Chris Lumens
 
Default Port bootloader --hvargs option from rhel 5.

> >Since this option is only supported on the RHEL5 tree, not any Fedora
> >tree, what you should instead do is create a new RHEL5_Bootloader class
> >that derives from FC4_Bootloader and add the option onto that.
>
> Ah, I think I understand it now - and if we wanted to be able parse
> (not to crash on)
> --hvargs in rhel6, we would add it to RHEL6_Bootloader derived from
> something
> like F12_Bootloader, right?

Yep, exactly right.

- Chris

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

Thread Tools




All times are GMT. The time now is 11:51 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org