]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/CephConfig.pm
CephConfig: map special config key characters to _
[pve-storage.git] / PVE / CephConfig.pm
index 1719b8b5ba04e66e8224cbb35234900eba4318fd..ced8358f4186de91eb6213736a132cc8cbe4e272 100644 (file)
@@ -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;
        }
 
     }