Bug 578514
| Summary: | pykickstart doesn't support RAID4 | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Alexander Todorov <atodorov> | ||||
| Component: | pykickstart | Assignee: | Chris Lumens <clumens> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Release Test Team <release-test-team-automation> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 6.0 | Keywords: | TestBlocker | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | anaconda_trace_hash:b4e8c4036508d579b4f403476b41a2ad1f00419a93a6d682fbafdc0c959760d6 | ||||||
| Fixed In Version: | pykickstart-1.70-1 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2010-11-10 21:22:34 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
Created attachment 403755 [details]
Attached traceback automatically from anaconda.
I believe this is pykickstart not anaconda, changing component and summary to reflect that.
It looks like pykcikstart is not aware of RAID4 at all.
Looking at commands/raid.py in git I see:
self.levelMap = { "RAID0": "RAID0", "0": "RAID0",
"RAID1": "RAID1", "1": "RAID1",
"RAID5": "RAID5", "5": "RAID5",
"RAID6": "RAID6", "6": "RAID6" }
No trace of RAID4 at all, while anaconda UI shows it as available option.
The pykickstart code that I was using was (raid4_xfs RHTS test case):
# create raid4 device and members
members = list()
for devNum in range(1,5):
members.append(ks.PartData(mountpoint="raid.0%d" % devNum, size=2048, grow=True, format=True))
md0 = ks.RaidData(mountpoint="/", fstype="xfs", device="md0", format=True, level="RAID4", members=map(lambda m: m.mountpoint, members))
This resulted in a ks.cfg definition which doesn't specify RAID level and caused anaconda to traceback.
This patch should fix it but I've not tested it.
diff --git a/pykickstart/commands/raid.py b/pykickstart/commands/raid.py
index c9d4342..abbf799 100644
--- a/pykickstart/commands/raid.py
+++ b/pykickstart/commands/raid.py
@@ -316,3 +316,12 @@ class F12_Raid(F9_Raid):
op.add_option("--escrowcert")
op.add_option("--backuppassphrase", action="store_true", default=False)
return op
+
+class RHEL6_Raid(F12_Raid):
+ removedKeywords = F12_Raid.removedKeywords
+ removedAttrs = F12_Raid.removedAttrs
+
+ def __init__(self, writePriority=131, *args, **kwargs):
+ F12_Raid.__init__(self, writePriority, *args, **kwargs)
+
+ self.levelMap.update({"RAID4": "RAID4", "4": "RAID4"})
diff --git a/pykickstart/handlers/control.py b/pykickstart/handlers/control.py
index ed27c6a..506a15b 100644
--- a/pykickstart/handlers/control.py
+++ b/pykickstart/handlers/control.py
@@ -848,7 +848,7 @@ commandMap = {
"part": partition.F12_Partition,
"partition": partition.F12_Partition,
"poweroff": reboot.FC6_Reboot,
- "raid": raid.F12_Raid,
+ "raid": raid.RHEL6_Raid,
"reboot": reboot.FC6_Reboot,
"repo": repo.F13_Repo,
"rescue": rescue.F10_Rescue,
Basic patch looks okay, though I need to make sure F13 supports RAID4 as well so I'll change around the names of the classes a little bit. I'll also add a test case. Tested with pykickstart-1.74-1.el6.noarch and snake-0.11-0.20.el6.noarch installed on a RHEL6 server. My template is:
from pykickstart.version import RHEL6
from defaults import Defaults
# minimal install, procedural style
def ks(**context):
'''Partitioning / raid4_xfs'''
ks=Defaults()
ks.version=RHEL6
ks.packages.add(['@base'])
ks.autopart(autopart=False)
# create raid4 device and members
members = list()
for devNum in range(1,5):
members.append(ks.PartData(mountpoint="raid.0%d" % devNum, size=2048, grow=False, format=True))
md0 = ks.RaidData(mountpoint="/usr", fstype="xfs", device="md0", format=True, level="RAID4", members=map(lambda m: m.mountpoint, members))
root = ks.PartData(mountpoint="/", fstype="ext4", size=2048, grow=True, format=True)
for member in members:
ks.partition.partitions.append(member)
ks.partition.partitions.append(md0)
ks.partition.partitions.append(root)
return ks
snake-ks generate generated the correct ks.cfg file. Moving to VERIFIED.
Red Hat Enterprise Linux 6.0 is now available and should resolve the problem described in this bug report. This report is therefore being closed with a resolution of CURRENTRELEASE. You may reopen this bug report if the solution does not work for you. |
The following was filed automatically by anaconda: anaconda 13.21.20.2 exception report Traceback (most recent call first): File "/usr/lib/anaconda/kickstart.py", line 835, in execute raise KickstartValueError, formatErrorMsg(self.lineno, msg="RAID Partition defined without RAID level") File "/usr/lib/anaconda/kickstart.py", line 1086, in execute obj.execute(self.anaconda) File "/usr/bin/anaconda", line 1035, in <module> ksdata.execute() KickstartValueError: The following problem occurred on line 36 of the kickstart file: RAID Partition defined without RAID level