From: Michael Fritch Date: Tue, 25 Aug 2020 13:55:08 +0000 (-0600) Subject: cephadm: infer latest image with a valid tag X-Git-Tag: v16.1.0~1317^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d61676f92dc701daeab71bd9d9c35d6cfa9a6434;p=ceph.git cephadm: infer latest image with a valid tag Fixes: https://tracker.ceph.com/issues/47134 Signed-off-by: Michael Fritch --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 07e3e9df73bd4..729da37446a6a 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -1225,12 +1225,12 @@ def get_last_local_ceph_image(): [container_path, 'images', '--filter', 'label=ceph=True', '--format', '{{.Repository}} {{.Tag}}']) - out_lines = out.splitlines() - if len(out_lines) > 0: - repository, tag = out_lines[0].split() - r = '{}:{}'.format(repository, tag) - logger.info('Using recent ceph image %s' % r) - return r + for line in out.splitlines(): + if len(line.split()) == 2: + repository, tag = line.split() + r = '{}:{}'.format(repository, tag) + logger.info('Using recent ceph image %s' % r) + return r return None