Commit 7223f3ac authored by Côme Chilliet's avatar Côme Chilliet

🚑 fix(fai) Fix partitions cn in case of disk

sda should give sda1 but disk1 must give disk1.1 as first partition cn

issue #5821
parent bb91b8ad
......@@ -167,7 +167,11 @@ class DiskPartitionsAttribute extends DialogOrderedArrayAttribute
}
if ($this->plugin->FAIdiskType == 'disk') {
if (preg_match('/^disk(\d+)$/', $this->plugin->cn)) {
$part['cn'] = $this->plugin->cn.'.'.$part['FAIpartitionNr'];
} else {
$part['cn'] = $this->plugin->cn.$part['FAIpartitionNr'];
}
} elseif ($this->plugin->FAIdiskType == 'lvm') {
/* Check if we need to update partition names of lvm compilations */
if (isset($this->value[$part['FAIpartitionNr']])) {
......@@ -400,7 +404,11 @@ class faiDiskEntry extends simplePlugin
foreach ($partitions as $key => $val) {
$partitions[$key]['FAIpartitionNr'] = $key;
if ($this->FAIdiskType == 'disk') {
if (preg_match('/^disk(\d+)$/', $this->cn)) {
$partitions[$key]['cn'] = $this->cn.'.'.$key;
} else {
$partitions[$key]['cn'] = $this->cn.$key;
}
} elseif ($this->FAIdiskType == 'lvm') {
$partitions[$key]['FAIpartitionType'] = 'lvm';
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment