From: Zack Cerza Date: Mon, 14 Feb 2022 23:02:33 +0000 (-0700) Subject: cephadm: Make hostname change idempotent X-Git-Tag: v18.0.0~1264^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0f1118e2287597f49a6a18f87c0ed7695ce11e3a;p=ceph.git cephadm: Make hostname change idempotent Inside a container, we may already have a short hostname - and also lack the privileges to change it. Signed-off-by: Zack Cerza --- diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index 602676eed7f7..ae0fd02c8ab4 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -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)'),