feat: MSA import reads disk group exports and loosely named columns
The disk group export of an HPE MSA sets RAID level and pool on the RAID groups of the selected devices. Column names are matched case- and punctuation-insensitively with common aliases, positions are accepted as 1.4, 1:4, 1/4 or "Enclosure 1, Slot 4" or as separate enclosure and slot columns, and both export kinds are detected in the regular disk import. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
2b40fbfae0
commit
95fd28f2a4
6 files changed
+415
-49
No files matched your search
@@ -511,7 +511,7 @@ class MSAUploadForm(forms.Form):
|
||||
if not data or not str(data).strip():
|
||||
raise ValidationError("Bitte eine CSV-Datei hochladen oder den Inhalt einfügen.")
|
||||
export = msa_import.parse_export(data)
|
||||
if not export.disks:
|
||||
if export.is_empty:
|
||||
raise ValidationError(export.errors)
|
||||
cleaned_data["export"] = export
|
||||
cleaned_data["raw"] = data if isinstance(data, str) else msa_import.decode(data)
|
||||
@@ -575,3 +575,19 @@ class MSAAssignForm(forms.Form):
|
||||
seen[device.pk] = enclosure
|
||||
cleaned_data["assigned"] = assigned
|
||||
return cleaned_data
|
||||
|
||||
|
||||
class MSAGroupAssignForm(forms.Form):
|
||||
"""Disk group export: which devices get the RAID levels of the listed disk groups."""
|
||||
|
||||
devices = DynamicModelMultipleChoiceField(
|
||||
label="Geräte",
|
||||
queryset=Device.objects.all(),
|
||||
help_text="Alle Shelfs der MSA, deren Datenträger zu diesen Disk Groups gehören.",
|
||||
)
|
||||
create_missing = forms.BooleanField(
|
||||
label="Fehlende RAID-Gruppen anlegen",
|
||||
required=False,
|
||||
widget=forms.CheckboxInput(attrs={"class": "form-check-input"}),
|
||||
help_text="Sonst werden nur vorhandene Gruppen mit gleichem Namen aktualisiert.",
|
||||
)
|
||||
Reference in new issue
Block a user