]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: Make hostname change idempotent 45034/head
authorZack Cerza <zack@redhat.com>
Mon, 14 Feb 2022 23:02:33 +0000 (16:02 -0700)
committerZack Cerza <zack@redhat.com>
Wed, 16 Feb 2022 19:13:05 +0000 (12:13 -0700)
Inside a container, we may already have a short hostname - and also lack
the privileges to change it.

Signed-off-by: Zack Cerza <zack@redhat.com>
qa/tasks/cephadm.py

index 602676eed7f736c77b5a3c256bec51307324fe7a..ae0fd02c8ab45576da616d96f767622d0a75b272 100644 (file)
@@ -105,7 +105,8 @@ def normalize_hostnames(ctx):
     remote.shortname and socket.gethostname() in cephadm.
     """
     log.info('Normalizing hostnames...')
-    ctx.cluster.run(args=[
+    cluster = ctx.cluster.filter(lambda r: '.' in r.hostname)
+    cluster.run(args=[
         'sudo',
         'hostname',
         run.Raw('$(hostname -s)'),