Skip to content

Commit

Permalink
use lowercase for str compare
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxue Wang <[email protected]>
  • Loading branch information
JoySnow committed Dec 16, 2024
1 parent acc6ab7 commit 79b6c66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions insights/specs/datasources/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
from insights.specs import Specs

_aws_imdsv2_token_invalid_keyworks = [
'Warning: ',
'curlrc: '
'warning: ',
]


Expand Down Expand Up @@ -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)))
Expand Down

0 comments on commit 79b6c66

Please sign in to comment.