Skip to content

Conversation

@atownsend247
Copy link

When running via ansible 2.10.7 you are presented with a few SyntaxWarnings everytime a function is referenced, see below code block, this PR resolves this by swapping the is comparator for empty strings to == instead.

12:24:46  TASK [Get the current caller identity information] *****************************
12:24:47  ok: [localhost]
12:24:47  
12:24:47  TASK [update kube config] ******************************************************
12:24:47  /opt/ansible/plugins/ansible-filter-plugins/plugins/filters/string_utils.py:51: SyntaxWarning: "is" with a literal. Did you mean "=="?
12:24:47    if needle is '' or needle is None:
12:24:47  /opt/ansible/plugins/ansible-filter-plugins/plugins/filters/string_utils.py:71: SyntaxWarning: "is" with a literal. Did you mean "=="?
12:24:47    if sanitzed_string is '' or sanitzed_string is None:
12:24:47  /opt/ansible/plugins/ansible-filter-plugins/plugins/filters/string_utils.py:81: SyntaxWarning: "is" with a literal. Did you mean "=="?
12:24:47    if sanitzed_string is '' or sanitzed_string is None:
12:24:47  /opt/ansible/plugins/ansible-filter-plugins/plugins/filters/string_utils.py:116: SyntaxWarning: "is" with a literal. Did you mean "=="?
12:24:47    if string is '' or string is None:
12:24:58  ok: [localhost]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant