]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: prepare-host: do not create Packager unless we need it 33443/head
authorSage Weil <sage@redhat.com>
Thu, 20 Feb 2020 19:20:44 +0000 (13:20 -0600)
committerSage Weil <sage@redhat.com>
Thu, 20 Feb 2020 19:20:44 +0000 (13:20 -0600)
Otherwise, bootstrap may fail on an unrecognized/unsupported distro even
though all the dependencies are present.

Signed-off-by: Sage Weil <sage@redhat.com>
src/cephadm/cephadm

index 36a35a7f40a8d6c8f4ac4f894e767f71138e897f..56dd09dc7cc745ee6df753be44b35c457237e8ae 100755 (executable)
@@ -2624,17 +2624,23 @@ def command_check_host():
 ##################################
 
 def command_prepare_host():
-    pkg = create_packager()
     logger.info('Verifying podman|docker is present...')
+    pkg = None
     if not container_path:
+        if not pkg:
+            pkg = create_packager()
         pkg.install_podman()
 
     logger.info('Verifying lvm2 is present...')
     if not find_executable('lvcreate'):
+        if not pkg:
+            pkg = create_packager()
         pkg.install(['lvm2'])
 
     logger.info('Verifying time synchronization is in place...')
     if not check_time_sync():
+        if not pkg:
+            pkg = create_packager()
         pkg.install(['chrony'])
 
     if 'expect_hostname' in args and args.expect_hostname and args.expect_hostname != get_hostname():