[pykickstart][PATCH] Add --same-sa-ram option for swap size specification (#744129)

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

 



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