[pykickstart][PATCH 2/3] Add support for specifying thin pool profile
David Lehman
dlehman at redhat.com
Tue Jan 27 18:10:30 UTC 2015
From: Vratislav Podzimek <vpodzime at redhat.com>
(cherry picked from commit c088a5a62c4bf133a5e3b00da3803f2f59974a76)
Related: rhbz#1083459
---
pykickstart/commands/logvol.py | 5 +++++
tests/commands/logvol.py | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/pykickstart/commands/logvol.py b/pykickstart/commands/logvol.py
index 4f20ad3..102b6d0 100644
--- a/pykickstart/commands/logvol.py
+++ b/pykickstart/commands/logvol.py
@@ -175,6 +175,7 @@ class RHEL6_LogVolData(F12_LogVolData):
self.pool_name = kwargs.get("pool_name", "")
self.chunk_size = kwargs.get("chunk_size", None) # kilobytes
self.metadata_size = kwargs.get("metadata_size", None) # megabytes
+ self.profile = kwargs.get("profile", "")
def _getArgsAsStr(self):
retval = F12_LogVolData._getArgsAsStr(self)
@@ -197,6 +198,9 @@ class RHEL6_LogVolData(F12_LogVolData):
if self.thin_volume:
retval += " --thin --poolname=%s" % self.pool_name
+ if self.profile:
+ retval += "--profile=%s" % self.profile
+
return retval
class FC3_LogVol(KickstartCommand):
@@ -323,6 +327,7 @@ class RHEL6_LogVol(F12_LogVol):
op.add_option("--poolname", dest="pool_name")
op.add_option("--chunksize", type="int", dest="chunk_size")
op.add_option("--metadatasize", type="int", dest="metadata_size")
+ op.add_option("--profile")
return op
def parse(self, args):
diff --git a/tests/commands/logvol.py b/tests/commands/logvol.py
index 5accb5a..6dbf5a0 100644
--- a/tests/commands/logvol.py
+++ b/tests/commands/logvol.py
@@ -282,5 +282,10 @@ class RHEL6_TestCase(F12_TestCase):
self.assert_parse_error("logvol none --name=pool1 --vgname=vg "
"--chunksize=512")
+ # --profile should work for all logvol commands even though it may be
+ # implemented only for some types (thin pool,...)
+ self.assert_parse("logvol none --name=pool1 --vgname=vg --thinpool --profile=performance --size=500")
+ self.assert_parse("logvol /home --name=homelv --vgname=vg --profile=performance --size=500")
+
if __name__ == "__main__":
unittest.main()
--
1.9.3
More information about the anaconda-patches
mailing list