]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: expose `timeout` for `is_available` check
authorMichael Fritch <mfritch@suse.com>
Wed, 12 Feb 2020 17:39:27 +0000 (10:39 -0700)
committerMichael Fritch <mfritch@suse.com>
Fri, 14 Feb 2020 22:07:17 +0000 (15:07 -0700)
allow for the `--timeout` arg to override the default 30sec timeout
while waiting for a service to become available

Signed-off-by: Michael Fritch <mfritch@suse.com>
src/cephadm/cephadm

index 533c084e8732bde2c43b10fe70884f396c8d1ba0..71ca3c338032bedca018b61677eaa47f55b037a2 100755 (executable)
@@ -1798,8 +1798,12 @@ def command_bootstrap():
         },
     )
 
+    # wait for the service to become available
     def is_mon_available():
-        out, err, ret = call(c.run_cmd(), desc=c.entrypoint, timeout=30)
+        timeout=args.timeout if args.timeout else 30 # seconds
+        out, err, ret = call(c.run_cmd(),
+                             desc=c.entrypoint,
+                             timeout=timeout)
         return ret == 0
     is_available('mon', is_mon_available)()
 
@@ -1851,9 +1855,11 @@ def command_bootstrap():
         f.write(config)
     logger.info('Wrote config to %s' % args.output_config)
 
+    # wait for the service to become available
     logger.info('Waiting for mgr to start...')
     def is_mgr_available():
-        out = cli(['status', '-f', 'json-pretty'], timeout=30)
+        timeout=args.timeout if args.timeout else 30 # seconds
+        out = cli(['status', '-f', 'json-pretty'], timeout=timeout)
         j = json.loads(out)
         return j.get('mgrmap', {}).get('available', False)
     is_available('mgr', is_mgr_available)()
@@ -1899,9 +1905,11 @@ def command_bootstrap():
         logger.info('Enabling the dashboard module...')
         cli(['mgr', 'module', 'enable', 'dashboard'])
 
+        # wait for the service to become available
         logger.info('Waiting for the dashboard to start...')
         def is_dashboard_available():
-            out = cli(['-h'], timeout=30)
+            timeout=args.timeout if args.timeout else 30 # seconds
+            out = cli(['-h'], timeout=timeout)
             return 'dashboard' in out
         is_available('Dashboard', is_dashboard_available)()