From: Sage Weil Date: Mon, 9 Mar 2020 20:45:36 +0000 (-0500) Subject: cephadm: bootstrap: tolerate error return from -h X-Git-Tag: v15.1.1~53^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=43e28a0bae37c864725f35863ddd3bb418fc904c;p=ceph.git cephadm: bootstrap: tolerate error return from -h Sometimes we time out connecting to the mon to get commands and return an error code. See https://tracker.ceph.com/issues/44526 Signed-off-by: Sage Weil --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 3a859e566e42..93a9a4f1504f 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -2048,8 +2048,13 @@ def command_bootstrap(): def is_dashboard_available(): # type: () -> bool timeout=args.timeout if args.timeout else 30 # seconds - out = cli(['-h'], timeout=timeout) - return 'dashboard' in out + try: + out = cli(['-h'], timeout=timeout) + return 'dashboard' in out + except RuntimeError as e: + # sometimes -h command times out/errors out + logger.debug('Command errored out: %s' % e) + return False is_available('Dashboard', is_dashboard_available)