From: Wido den Hollander <wido@widodh.nl>
To: ceph-devel@vger.kernel.org
Cc: Wido den Hollander <wido@widodh.nl>
Subject: [PATCH] Write correct 'mon_host' with IPv6 addresses
Date: Thu, 8 May 2014 13:44:43 +0200 [thread overview]
Message-ID: <1399549483-14813-1-git-send-email-wido@widodh.nl> (raw)
When the IP-address from a monitor is a IPv6 address, encapsulate
it with [ and ]
Fixes: #8309
Signed-off-by: Wido den Hollander <wido@widodh.nl>
---
ceph_deploy/new.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/ceph_deploy/new.py b/ceph_deploy/new.py
index 3680821..fc4c5f4 100644
--- a/ceph_deploy/new.py
+++ b/ceph_deploy/new.py
@@ -5,6 +5,7 @@ import uuid
import struct
import time
import base64
+import socket
from ceph_deploy.cliutil import priority
from ceph_deploy import conf, hosts, exc
@@ -90,7 +91,12 @@ def new(args):
ip = net.get_nonlocal_ip(host)
LOG.debug('Monitor %s at %s', name, ip)
mon_initial_members.append(name)
- mon_host.append(ip)
+ try:
+ socket.inet_pton(socket.AF_INET6, ip)
+ mon_host.append("[" + ip + "]")
+ except socket.error:
+ mon_host.append(ip)
+
if args.ssh_copykey:
ssh_copy_keys(host, args.username)
--
1.7.9.5
reply other threads:[~2014-05-08 11:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1399549483-14813-1-git-send-email-wido@widodh.nl \
--to=wido@widodh.nl \
--cc=ceph-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.