]> git.proxmox.com Git - pve-manager.git/commitdiff
ceph: brackets around ipv6
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 17 May 2016 08:38:01 +0000 (10:38 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 17 May 2016 14:05:21 +0000 (16:05 +0200)
PVE/API2/Ceph.pm

index 6c5f8f58e23e512ff76441760526ece76fa16a61..58e5b3598594e8db1f07182bd48f2994fd2ebac8 100644 (file)
@@ -3,6 +3,7 @@ package PVE::API2::CephOSD;
 use strict;
 use warnings;
 use Cwd qw(abs_path);
+use Net::IP;
 
 use PVE::SafeSyslog;
 use PVE::Tools qw(extract_param run_command file_get_contents file_read_firstline dir_glob_regex dir_glob_foreach);
@@ -868,7 +869,7 @@ __PACKAGE__->register_method ({
            $ip = PVE::Cluster::remote_node_ip($param->{node});
        }
 
-       my $monaddr = "$ip:6789";
+       my $monaddr = Net::IP::ip_is_ipv6($ip) ? "[$ip]:6789" : "$ip:6789";
        my $monname = $param->{node};
 
        die "monitor '$monsection' already exists\n" if $cfg->{$monsection};