From 0f1118e2287597f49a6a18f87c0ed7695ce11e3a Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Mon, 14 Feb 2022 16:02:33 -0700 Subject: [PATCH] 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 --- qa/tasks/cephadm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)'), -- 2.47.3