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>
}
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;
}
}