diff mbox

[2/2] Set ms_bind_ipv6 to true when IPv6 is used

Message ID 1399624575-4772-1-git-send-email-wido@widodh.nl (mailing list archive)
State New, archived
Headers show

Commit Message

Wido den Hollander May 9, 2014, 8:36 a.m. UTC
Signed-off-by: Wido den Hollander <wido@widodh.nl>
---
 ceph_deploy/new.py |    6 ++++++
 1 file changed, 6 insertions(+)
diff mbox

Patch

diff --git a/ceph_deploy/new.py b/ceph_deploy/new.py
index fc4c5f4..e573128 100644
--- a/ceph_deploy/new.py
+++ b/ceph_deploy/new.py
@@ -91,9 +91,11 @@  def new(args):
         ip = net.get_nonlocal_ip(host)
         LOG.debug('Monitor %s at %s', name, ip)
         mon_initial_members.append(name)
+        ms_ipv6 = False
         try:
             socket.inet_pton(socket.AF_INET6, ip)
             mon_host.append("[" + ip + "]")
+            ms_ipv6 = True
         except socket.error:
             mon_host.append(ip)
 
@@ -106,6 +108,10 @@  def new(args):
     cfg.set('global', 'mon initial members', ', '.join(mon_initial_members))
     # no spaces here, see http://tracker.newdream.net/issues/3145
     cfg.set('global', 'mon host', ','.join(mon_host))
+    
+    if ms_ipv6 == True:
+        LOG.debug('Monitors are IPv6, binding Messenger traffic on IPv6')
+        cfg.set('global', 'ms bind ipv6', 'true')
 
     # override undesirable defaults, needed until bobtail