From b38012dc16fe8c0fb9a33dfadca346c336ef357b Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Tue, 15 Aug 2023 12:05:38 -0600 Subject: [PATCH] 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 --- teuthology/nuke/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: