William Horn created AMBARI-26070:
-------------------------------------
Summary: Ambari throws SyntaxWarnings after moving to Python3
Key: AMBARI-26070
URL: https://issues.apache.org/jira/browse/AMBARI-26070
Project: Ambari
Issue Type: Bug
Components: ambari-agent, ambari-server
Affects Versions: 3.0.0
Reporter: William Horn
Attachments: after.png, before.png
The Python project introduced new SyntaxWarnings in Python 3.8 to warn users
against using 'is' and 'is not' keywords when comparing string literals, as
this is an identity comparison when an equality comparison ('==' and '!=') is
more likely the intended logic.
After this update in the Python project, and moving to Python 3.9 in
[AMBARI-26000|http://example.com] (see the change
[here|https://github.com/generalmotors/ambari/commit/5f95ec6c60ef17d65b0ef2b059feb1b9c482aaa4#diff-1082505afdedea77cad7c38946ff8c5c6eeab614d300e661710e25b09e9bd981]
to imply the target python version is 3.9), these SyntaxWarnings are exposed
when running any ambari-server script commands, as well as within ambari-agent
logs.
The fix is simply replacing the 'is' and 'is not' keywords with their equality
equivalents.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]