Skip to content

Commit

Permalink
nuke: Avoid a TypeError w/ null node description
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
zmc committed Aug 15, 2023
1 parent 5435569 commit b38012d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions teuthology/nuke/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b38012d

Please sign in to comment.