Merge pull request #36797 from mgfritch/cephadm-infer-image-no-tag

cephadm: infer latest image with a valid tag

Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
Reviewed-by: Varsha Rao <varao@redhat.com>
This commit is contained in:
Sebastian Wagner 2020-08-27 12:03:23 +02:00 committed by GitHub
commit 63c7e27072
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1226,12 +1226,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