Skip to content

Commit

Permalink
pylint: Fix use-implicit-booleaness-not-comparison
Browse files Browse the repository at this point in the history
Pylint 2.12.0 introduced new checker:
> Used when Pylint detects that collection literal comparison is being
  used to check for emptiness; Use implicit booleaness insteadof a
  collection classes; empty collections are considered as false

See pylint-dev/pylint#4774

Fixes: #279
Signed-off-by: Stanislav Levin <slev@altlinux.org>
  • Loading branch information
stanislavlevin authored and olivergs committed Mar 3, 2022
1 parent 655790a commit 1a46796
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion admin/fleetcommander/fcfreeipa.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def _update_profile_rules(self, profile, oldname=None):
rule = self.get_profile_rule(name)
applies = self._get_profile_applies_from_rule(rule)
logger.debug("FreeIPAConnector: Applies after update: %s", applies)
if applies["hosts"] == [] and applies["hostgroups"] == []:
if not applies["hosts"] and not applies["hostgroups"]:
logger.debug("FreeIPAConnector: Setting hostcategory to all")
parms["hostcategory"] = "all"
try:
Expand Down
3 changes: 2 additions & 1 deletion tests/_logger_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def test_03_inhibitor_uninhibit(self):
inhibitor.screensavers["org.freedesktop.ScreenSaver"]["cookie"] == 9191
)
inhibitor.uninhibit()
self.assertTrue(inhibitor.screensavers == {})
self.assertIsInstance(inhibitor.screensavers, dict)
self.assertFalse(inhibitor.screensavers)


class TestDconfLogger(unittest.TestCase):
Expand Down

0 comments on commit 1a46796

Please sign in to comment.