» Linux Archive
Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.
» Sponsor
» Sponsor
02-17-2012, 12:36 PM
Add --same-sa-ram option for swap size specification (#744129)
---
pykickstart/commands/partition.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/pykickstart/commands/partition.py b/pykickstart/commands/partition.py
index 70b2283..c66509e 100644
--- a/pykickstart/commands/partition.py
+++ b/pykickstart/commands/partition.py
@@ -168,6 +168,7 @@ class F12_PartData(F11_PartData):
self.escrowcert = kwargs.get("escrowcert", "")
self.backuppassphrase = kwargs.get("backuppassphrase", False)
+ self.sameAsRam = kwargs.get("sameAsRam", False)
def _getArgsAsStr(self):
retval = F11_PartData._getArgsAsStr(self)
@@ -178,6 +179,9 @@ class F12_PartData(F11_PartData):
if self.backuppassphrase:
retval += " --backuppassphrase"
+ if self.sameAsRam:
+ retval += " --same-as-ram"
+
return retval
@@ -228,6 +232,8 @@ class FC3_Partition(KickstartCommand):
callback=part_cb, nargs=1, type="string")
op.add_option("--recommended", dest="recommended", action="store_true",
default=False)
+ op.add_option("--same-as-ram", dest="sameAsRam", action="store_true",
+ default=False)
op.add_option("--size", dest="size", action="store", type="int",
nargs=1)
op.add_option("--start", dest="start", action="store", type="int",
--
1.7.4.4
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
02-17-2012, 02:21 PM
Add --same-sa-ram option for swap size specification (#744129)
> diff --git a/pykickstart/commands/partition.py b/pykickstart/commands/partition.py
> index 70b2283..c66509e 100644
> --- a/pykickstart/commands/partition.py
> +++ b/pykickstart/commands/partition.py
> @@ -168,6 +168,7 @@ class F12_PartData(F11_PartData):
>
> self.escrowcert = kwargs.get("escrowcert", "")
> self.backuppassphrase = kwargs.get("backuppassphrase", False)
> + self.sameAsRam = kwargs.get("sameAsRam", False)
>
> def _getArgsAsStr(self):
> retval = F11_PartData._getArgsAsStr(self)
We didn't have this option in F12, though.
You'll need to create a new RHEL6_PartData inheriting from F12_PartData
and a new RHEL6_Partition inheriting from F12_Partition for these
options. Remember then to update pykickstart/handlers/control in the
RHEL6 block and the inheritance chain in anaconda's kickstart.py.
Let me know if you have any questions, though there should be plenty of
examples for you to copy-and-paste from already.
- Chris
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
02-24-2012, 10:18 AM
Add --same-sa-ram option for swap size specification (#744129)
---
pykickstart/commands/partition.py | 27 +++++++++++++++++++++++++++
pykickstart/handlers/control.py | 6 +++---
2 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/pykickstart/commands/partition.py b/pykickstart/commands/partition.py
index 70b2283..4a90156 100644
--- a/pykickstart/commands/partition.py
+++ b/pykickstart/commands/partition.py
@@ -180,6 +180,22 @@ class F12_PartData(F11_PartData):
return retval
+class RHEL6_PartData(F12_PartData):
+ removedKeywords = F12_PartData.removedKeywords
+ removedAttrs = F12_PartData.removedAttrs
+
+ def __init__(self, *args, **kwargs):
+ F12_PartData.__init__(self, *args, **kwargs)
+
+ self.sameAsRam = kwargs.get("sameAsRam", False)
+
+ def _getArgsAsStr(self):
+ retval = F11_PartData._getArgsAsStr(self)
+
+ if self.sameAsRam:
+ retval += "--same-as-ram"
+
+ return retval
class FC3_Partition(KickstartCommand):
removedKeywords = KickstartCommand.removedKeywords
@@ -334,3 +350,14 @@ class F12_Partition(F11_Partition):
op.add_option("--escrowcert")
op.add_option("--backuppassphrase", action="store_true", default=False)
return op
+
+class RHEL6_Partition(F12_Partition):
+ removedKeywords = F12_Partition.removedKeywords
+ removedAttrs = F12_Partition.removedAttrs
+
+ def _getParser(self):
+ op = F12_Partition._getParser(self)
+ op.add_option("--same-as-ram", dest="sameAsRam", action="store_true",
+ default=False)
+ return op
+
diff --git a/pykickstart/handlers/control.py b/pykickstart/handlers/control.py
index e89d10c..0ee97ad 100644
--- a/pykickstart/handlers/control.py
+++ b/pykickstart/handlers/control.py
@@ -845,8 +845,8 @@ commandMap = {
"multipath": multipath.FC6_MultiPath,
"network": network.RHEL6_Network,
"nfs": method.RHEL6_Method,
- "part": partition.F12_Partition,
- "partition": partition.F12_Partition,
+ "part": partition.RHEL6_Partition,
+ "partition": partition.RHEL6_Partition,
"poweroff": reboot.FC6_Reboot,
"raid": raid.F13_Raid,
"reboot": reboot.FC6_Reboot,
@@ -1071,7 +1071,7 @@ dataMap = {
"LogVolData": logvol.F12_LogVolData,
"MultiPathData": multipath.FC6_MultiPathData,
"NetworkData": network.RHEL6_NetworkData,
- "PartData": partition.F12_PartData,
+ "PartData": partition.RHEL6_PartData,
"RaidData": raid.F13_RaidData,
"RepoData": repo.RHEL6_RepoData,
"SshPwData": sshpw.F13_SshPwData,
--
1.7.4.4
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
02-24-2012, 10:21 AM
Add --same-sa-ram option for swap size specification (#744129)
Commit message changed to 'Add --same-as-ram option for swap size
specification (#744129)'.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
All times are GMT. The time now is 02:53 AM .
VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org