From: Zack Cerza Date: Tue, 15 Aug 2023 18:05:38 +0000 (-0600) Subject: nuke: Avoid a TypeError w/ null node description X-Git-Tag: 1.2.0~76^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b38012dc16fe8c0fb9a33dfadca346c336ef357b;p=teuthology.git nuke: Avoid a TypeError w/ null node description This avoids a `TypeError: argument of type 'NoneType' is not iterable` when nuking a node whose description is None. ex: https://sentry.ceph.com/share/issue/91172146663f4c71a6cbfe43725b2e07/ Signed-off-by: Zack Cerza --- diff --git a/teuthology/nuke/__init__.py b/teuthology/nuke/__init__.py index fc498dd9a..8a2985b9e 100644 --- a/teuthology/nuke/__init__.py +++ b/teuthology/nuke/__init__.py @@ -245,11 +245,11 @@ def nuke(ctx, should_unlock, sync_clocks=True, noipmi=False, keep_logs=False, sh with parallel() as p: for target, hostkey in ctx.config['targets'].items(): status = get_status(target) - if ctx.name and ctx.name not in status.get('description', ""): + if ctx.name and ctx.name not in (status.get('description') or ""): total_unnuked[target] = hostkey log.info( f"Not nuking {target} because description doesn't match: " - f"{ctx.name} != {status['description']}" + f"{ctx.name} != {status.get('description')}" ) continue elif status.get('up') is False: