]> git.proxmox.com Git - pve-storage.git/commitdiff
rbd: monhost string : escape only ":" character
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 5 Mar 2015 09:29:29 +0000 (10:29 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 5 Mar 2015 12:59:35 +0000 (13:59 +0100)
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>
PVE/Storage/RBDPlugin.pm

index 2c1f6155242ebaa4220ea5458dc42d299ef6d324..2c45a68dc09871721c9a6074b963e8de1624eb5b 100644 (file)
@@ -177,13 +177,6 @@ sub rbd_volume_info {
     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);
@@ -258,7 +251,9 @@ sub path {
     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';