CephConfig: map special config key characters to _
we want a consistent config has, regardless of how the user or a tool adds it to the config, so we map ' ' and '-' to '_' in the keys this way we can always access the correct key without trying multiple times Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
committed by
Thomas Lamprecht
parent
de0cd0c2e0
commit
9841fa31b5
@ -33,7 +33,11 @@ sub parse_ceph_config {
|
||||
}
|
||||
|
||||
if ($line =~ m/^(.*?\S)\s*=\s*(\S.*)$/) {
|
||||
$cfg->{$section}->{$1} = $2;
|
||||
my ($key, $val) = ($1, $2);
|
||||
# ceph treats ' ', '_' and '-' in keys the same, so we
|
||||
# map it to '_' to get a consistent hash
|
||||
$key =~ s/[-\ ]/_/g;
|
||||
$cfg->{$section}->{$key} = $val;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user