From 79b6c66d22ec79b97ff249e7d791c6f6d21c5363 Mon Sep 17 00:00:00 2001 From: Xiaoxue Wang Date: Mon, 16 Dec 2024 14:22:48 +0800 Subject: [PATCH] use lowercase for str compare Signed-off-by: Xiaoxue Wang --- insights/specs/datasources/aws.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/insights/specs/datasources/aws.py b/insights/specs/datasources/aws.py index 77c8436883..4aafb8d0c2 100644 --- a/insights/specs/datasources/aws.py +++ b/insights/specs/datasources/aws.py @@ -9,8 +9,7 @@ from insights.specs import Specs _aws_imdsv2_token_invalid_keyworks = [ - 'Warning: ', - 'curlrc: ' + 'warning: ', ] @@ -42,7 +41,8 @@ def aws_imdsv2_token(broker): _token = broker[LocalSpecs.aws_imdsv2_token].content[0].strip() if _token: token = str(_token) - if token and not any(k in token for k in _aws_imdsv2_token_invalid_keyworks): + token_lower = token.lower() + if token and not any(k in token_lower for k in _aws_imdsv2_token_invalid_keyworks): return token except Exception as e: raise SkipComponent("Unexpected exception:{e}".format(e=str(e)))