Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix syntax errors on string comparator #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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