]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: don't forget ipv6 behind
authorJoao Eduardo Luis <joao@suse.com>
Thu, 31 Dec 2020 01:48:42 +0000 (01:48 +0000)
committerJuan Miguel Olmo Martínez <jolmomar@redhat.com>
Mon, 25 Jan 2021 17:39:21 +0000 (18:39 +0100)
Fixes a bug introduced earlier in the patchset. It's just too hard to go
back and fix it up with the right commit.

Signed-off-by: Joao Eduardo Luis <joao@suse.com>
(cherry picked from commit 13addf6f54ff256206679283e5bf0c9f0b0b8e04)

src/cephadm/cephadm

index 8875dd49c95edcacb50f587a6985cc37f6f17d35..272716cff20f8aecfef17d3db2f66928da12069e 100755 (executable)
@@ -3100,9 +3100,13 @@ def is_ipv6(ctx, address):
         return False
 
 
-def obtain_mon_ip(ctx: CephadmContext) -> Tuple[str, str]:
+def obtain_mon_ip(
+    ctx: CephadmContext
+) -> Tuple[str, str, bool]:
     r = re.compile(r':(\d+)$')
     base_ip = ""
+    ipv6 = False
+
     if ctx.args.mon_ip:
         ipv6 = is_ipv6(ctx, ctx.args.mon_ip)
         if ipv6:
@@ -3144,7 +3148,7 @@ def obtain_mon_ip(ctx: CephadmContext) -> Tuple[str, str]:
     else:
         raise Error('must specify --mon-ip or --mon-addrv')
     logger.debug('Base mon IP is %s, final addrv is %s' % (base_ip, addr_arg))
-    return (base_ip, addr_arg)
+    return (base_ip, addr_arg, ipv6)
 
 
 def create_initial_keys(
@@ -3594,13 +3598,12 @@ def command_bootstrap(ctx):
     mon_id = ctx.args.mon_id or hostname
     mgr_id = ctx.args.mgr_id or generate_service_id()
     logger.info('Cluster fsid: %s' % fsid)
-    ipv6 = False
 
     l = FileLock(ctx, fsid)
     l.acquire()
 
     # ip
-    (base_ip, addr_arg) = obtain_mon_ip(ctx)
+    (base_ip, addr_arg, ipv6) = obtain_mon_ip(ctx)
 
     mon_network = None
     if not ctx.args.skip_mon_network: