]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: share code between 'pull' and 'inspect-image' 32878/head
authorSage Weil <sage@redhat.com>
Wed, 29 Jan 2020 14:45:32 +0000 (08:45 -0600)
committerSage Weil <sage@redhat.com>
Wed, 29 Jan 2020 20:00:39 +0000 (14:00 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/cephadm/cephadm

index c91593d4d7c7999f521dbe2c1fdd517bddaf68c8..7f689a3f6d3cde1efb06c0c18dc9249c3cf48fdf 100755 (executable)
@@ -1538,19 +1538,10 @@ def command_version():
 ##################################
 
 def command_pull():
-    # type: () -> None
+    # type: () -> int
     logger.info('Pulling latest %s...' % args.image)
     call_throws([container_path, 'pull', args.image])
-    out, err, ret = call_throws([
-        container_path, 'inspect',
-        '--format', '{{.Id}}',
-        args.image])
-    ver = CephContainer(args.image, 'ceph', ['--version']).run()
-    image_id = normalize_container_id(out.strip())
-    print(json.dumps({
-        'ceph_version': ver.strip(),
-        'image_id': image_id,
-        }, indent=4, sort_keys=True))
+    return command_inspect_image()
 
 ##################################