we need to escape ":" used to defined mon ports
"10.5.0.11:6789; 10.5.0.12:6789; 10.5.0.13:6789"
->
"10.5.0.11\:6789; 10.5.0.12\:6789; 10.5.0.13\:6789"
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
return ($size, $parent, $format, $protected);
}
-sub addslashes {
- my $text = shift;
- $text =~ s/;/\\;/g;
- $text =~ s/:/\\:/g;
- return $text;
-}
-
# Configuration
PVE::JSONSchema::register_format('pve-storage-monhost', \&parse_monhost);
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
$name .= '@'.$snapname if $snapname;
- my $monhost = addslashes($scfg->{monhost});
+ my $monhost = $scfg->{monhost};
+ $monhost =~ s/:/\\:/g;
+
my $pool = $scfg->{pool} ? $scfg->{pool} : 'rbd';
my $username = $scfg->{username} ? $scfg->{username} : 'admin';