#7758 pylint-2.1.1 errors on Fedora 29
Closed: fixed Opened by cheimes.

Fedora 29 comes with python3-pylint-2.1.1-1. The new pylint version finds more issues in our code base. We need to fix these issues in master and 4.7 branch before we can move CI to F29.

Pylint on /usr/bin/python3 is running, please wait ...
************* Module ipasetup
ipasetup.py:44: [R1710(inconsistent-return-statements), build_py.build_module] Either all return statements in a function should return an expression, or none of them should.)
************* Module wsgi
install/share/wsgi.py:57: [R1710(inconsistent-return-statements), application] Either all return statements in a function should return an expression, or none of them should.)
************* Module lite-server
contrib/lite-server.py:246: [E1101(no-member), main] Instance of 'Env' has no 'lite_pem' member)
contrib/lite-server.py:248: [E1101(no-member), main] Instance of 'Env' has no 'lite_pem' member)
contrib/lite-server.py:258: [E1101(no-member), main] Instance of 'Env' has no 'lite_profiler' member)
contrib/lite-server.py:261: [E1101(no-member), main] Instance of 'Env' has no 'lite_profiler' member)
contrib/lite-server.py:262: [E1101(no-member), main] Instance of 'Env' has no 'lite_profiler' member)
contrib/lite-server.py:272: [E1101(no-member), main] Instance of 'Env' has no 'lite_host' member)
contrib/lite-server.py:273: [E1101(no-member), main] Instance of 'Env' has no 'lite_port' member)
internal error with sending report for module ['ipalib/rpc.py']
'NoneType' object has no attribute 'name'
************* Module ipatests.util
ipatests/util.py:74: [E1101(no-member), check_ipaclient_unittests] Module 'pytest' has no 'config' member)
ipatests/util.py:87: [E1101(no-member), check_no_ipaapi] Module 'pytest' has no 'config' member)
************* Module ipatests.test_cmdline.test_help
ipatests/test_cmdline/test_help.py:58: [R1710(inconsistent-return-statements), CLITestContext.__exit__] Either all return statements in a function should return an expression, or none of them should.)
************* Module ipatests.pytest_ipa.integration.tasks
ipatests/pytest_ipa/integration/tasks.py:1405: [R1710(inconsistent-return-statements), get_host_ip_with_hostmask] Either all return statements in a function should return an expression, or none of them should.)
************* Module ipatests.test_ipaplatform.test_tasks
ipatests/test_ipaplatform/test_tasks.py:24: [R0124(comparison-with-itself), test_ipa_version] Redundant comparison - v3 <= v3)
ipatests/test_ipaplatform/test_tasks.py:26: [R0124(comparison-with-itself), test_ipa_version] Redundant comparison - v3 == v3)
************* Module ipatests.test_webui.test_selfservice
ipatests/test_webui/test_selfservice.py:26: [C0414(useless-import-alias), ] Import alias does not rename original package)
************* Module ipatests.test_ipapython.test_ipautil
ipatests/test_ipapython/test_ipautil.py:186: [W1620(dict-iter-method), TestCIDict.test_items] Calling a dict.iter*() method)
ipatests/test_ipapython/test_ipautil.py:187: [W1655(dict-keys-not-iterating), TestCIDict.test_items] dict.keys referenced when not iterating)
ipatests/test_ipapython/test_ipautil.py:187: [W1656(dict-values-not-iterating), TestCIDict.test_items] dict.values referenced when not iterating)
ipatests/test_ipapython/test_ipautil.py:195: [W1620(dict-iter-method), TestCIDict.test_iteritems] Calling a dict.iter*() method)
ipatests/test_ipapython/test_ipautil.py:205: [W1620(dict-iter-method), TestCIDict.test_iterkeys] Calling a dict.iter*() method)
ipatests/test_ipapython/test_ipautil.py:215: [W1620(dict-iter-method), TestCIDict.test_itervalues] Calling a dict.iter*() method)
ipatests/test_ipapython/test_ipautil.py:231: [W1620(dict-iter-method), TestCIDict.test_keys] Calling a dict.iter*() method)
ipatests/test_ipapython/test_ipautil.py:241: [W1620(dict-iter-method), TestCIDict.test_values] Calling a dict.iter*() method)
************* Module ipatests.test_ipalib.test_text
ipatests/test_ipalib/test_text.py:217: [R0124(comparison-with-itself), test_Gettext.test_eq] Redundant comparison - inst1 == inst1)
ipatests/test_ipalib/test_text.py:295: [R0124(comparison-with-itself), test_NGettext.test_eq] Redundant comparison - inst1 == inst1)
************* Module ipatests.test_ipapython.test_dn
ipatests/test_ipapython/test_dn.py:325: [C0200(consider-using-enumerate), TestRDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:334: [C0200(consider-using-enumerate), TestRDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:344: [C0200(consider-using-enumerate), TestRDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:356: [C0200(consider-using-enumerate), TestRDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:366: [C0200(consider-using-enumerate), TestRDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:375: [C0200(consider-using-enumerate), TestRDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:388: [C0200(consider-using-enumerate), TestRDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:398: [C0200(consider-using-enumerate), TestRDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:407: [C0200(consider-using-enumerate), TestRDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:574: [C0200(consider-using-enumerate), TestRDN.test_concat] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:581: [C0200(consider-using-enumerate), TestRDN.test_concat] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:588: [C0200(consider-using-enumerate), TestRDN.test_concat] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:596: [C0200(consider-using-enumerate), TestRDN.test_concat] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:602: [C0200(consider-using-enumerate), TestRDN.test_concat] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:608: [C0200(consider-using-enumerate), TestRDN.test_concat] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:675: [C0200(consider-using-enumerate), TestDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:687: [C0200(consider-using-enumerate), TestDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:703: [C0200(consider-using-enumerate), TestDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:716: [C0200(consider-using-enumerate), TestDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:731: [C0200(consider-using-enumerate), TestDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:744: [C0200(consider-using-enumerate), TestDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:756: [C0200(consider-using-enumerate), TestDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:770: [C0200(consider-using-enumerate), TestDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:783: [C0200(consider-using-enumerate), TestDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:795: [C0200(consider-using-enumerate), TestDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:808: [C0200(consider-using-enumerate), TestDN.test_create] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:916: [R0124(comparison-with-itself), TestDN.test_cmp] Redundant comparison - container_dn in container_dn)
ipatests/test_ipapython/test_dn.py:1004: [C0200(consider-using-enumerate), TestDN.test_concat] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:1014: [C0200(consider-using-enumerate), TestDN.test_concat] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:1024: [C0200(consider-using-enumerate), TestDN.test_concat] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:1034: [C0200(consider-using-enumerate), TestDN.test_concat] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:1045: [C0200(consider-using-enumerate), TestDN.test_concat] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:1055: [C0200(consider-using-enumerate), TestDN.test_concat] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:1063: [C0200(consider-using-enumerate), TestDN.test_concat] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:1071: [C0200(consider-using-enumerate), TestDN.test_concat] Consider using enumerate instead of iterating with range and len)
ipatests/test_ipapython/test_dn.py:1080: [C0200(consider-using-enumerate), TestDN.test_concat] Consider using enumerate instead of iterating with range and len)
************* Module ipatests.test_integration.test_topology
ipatests/test_integration/test_topology.py:19: [R1710(inconsistent-return-statements), find_segment] Either all return statements in a function should return an expression, or none of them should.)
************* Module ipatests.test_integration.test_topologies
ipatests/test_integration/test_topologies.py:25: [W0143(comparison-with-callable), test_topology_star] Comparing against a callable, did you omit the parenthesis?)
ipatests/test_integration/test_topologies.py:38: [W0143(comparison-with-callable), test_topology_line] Comparing against a callable, did you omit the parenthesis?)
ipatests/test_integration/test_topologies.py:51: [W0143(comparison-with-callable), test_topology_tree] Comparing against a callable, did you omit the parenthesis?)
ipatests/test_integration/test_topologies.py:76: [W0143(comparison-with-callable), test_topology_tree2] Comparing against a callable, did you omit the parenthesis?)
ipatests/test_integration/test_topologies.py:89: [W0143(comparison-with-callable), test_topology_complete] Comparing against a callable, did you omit the parenthesis?)
ipatests/test_integration/test_topologies.py:103: [W0143(comparison-with-callable), test_topology_two_connected] Comparing against a callable, did you omit the parenthesis?)
ipatests/test_integration/test_topologies.py:123: [W0143(comparison-with-callable), test_topology_double_circle_topo] Comparing against a callable, did you omit the parenthesis?)
************* Module ipatests.test_ipalib.test_frontend
ipatests/test_ipalib/test_frontend.py:206: [R1710(inconsistent-return-statements), test_Command.get_subcls.Rule.__call__] Either all return statements in a function should return an expression, or none of them should.)
************* Module ipatests.test_webui.ui_driver
ipatests/test_webui/ui_driver.py:218: [R1714(consider-using-in), UI_driver.get_driver] Consider merging these comparisons with "in" to "browser in ('chrome', 'chromium')")
************* Module ipatests.test_xmlrpc.test_certmap_plugin
ipatests/test_xmlrpc/test_certmap_plugin.py:112: [W1654(dict-items-not-iterating), TestCRUD.test_update] dict.items referenced when not iterating)
ipatests/test_xmlrpc/test_certmap_plugin.py:190: [W1654(dict-items-not-iterating), TestAddRemoveCertmap.test_add_certmap] dict.items referenced when not iterating)
ipatests/test_xmlrpc/test_certmap_plugin.py:266: [R1710(inconsistent-return-statements), EWE.__exit__] Either all return statements in a function should return an expression, or none of them should.)
ipatests/test_xmlrpc/test_certmap_plugin.py:316: [W1656(dict-values-not-iterating), certmap_user_permissions] dict.values referenced when not iterating)
ipatests/test_xmlrpc/test_certmap_plugin.py:317: [W1656(dict-values-not-iterating), certmap_user_permissions] dict.values referenced when not iterating)
************* Module ipatests.test_xmlrpc.test_dns_realmdomains_integration
ipatests/test_xmlrpc/test_dns_realmdomains_integration.py:74: [R1710(inconsistent-return-statements), assert_realmdomain_and_txt_record_not_present] Either all return statements in a function should return an expression, or none of them should.)
************* Module ipatests.test_xmlrpc.test_baseldap_plugin
ipatests/test_xmlrpc/test_baseldap_plugin.py:188: [R1710(inconsistent-return-statements), test_entry_to_dict.FakeSchema.get_obj] Either all return statements in a function should return an expression, or none of them should.)
************* Module ipatests.test_xmlrpc.tracker.stageuser_plugin
ipatests/test_xmlrpc/tracker/stageuser_plugin.py:163: [R1714(consider-using-in), StageUserTracker.track_create] Consider merging these comparisons with "in" to "key in ('random', 'userpassword')")
************* Module ipaserver.install.custodiainstance
ipaserver/install/custodiainstance.py:80: [W0715(raising-format-tuple), get_custodia_instance] Exception arguments suggest string formatting might be intended)
-----------------------------------
Your code has been rated at 9.99/10
make: *** [Makefile:1263: pylint] Error 30

pylint 2.1.1 has a bug that causes pylint to fail with an internal error when analysing ipalib/rpc.py. See https://bugzilla.redhat.com/show_bug.cgi?id=1648299 and https://github.com/PyCQA/pylint/pull/2429

Metadata Update from @cheimes:
- Issue assigned to cheimes

Metadata Update from @cheimes:
- Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/2543

pylint build 2.1.1-2 is available. It comes with a backport of the upstream fix.

master:

  • e6d7f2003996a64ce25a9462ed2ca8f011573979 Ignore W504 code style like in travis config
  • 8944458d3c7147a1b6ca3f5e765d3c692baa0d2b Address pylint violations in lite-server
  • 85286beb5b4da390e24ee35b9c3cd4c2455a1961 Address inconsistent-return-statements
  • 7bdc9badfd53da88647deec5dfd05c3daad91820 Ignore consider-using-enumerate for now
  • 496d1756c9bdde3e161c0e18de9e3563dc98dbe7 Address consider-using-in
  • 83cdd27f97add9c202e0a2f79862f7da84f035d8 Fix comparison-with-callable
  • 713607769e3cc91f2f944eaf5637a06a21418c72 Fix useless-import-alias
  • 1e569c4f467b2941191316a80610c907b7c7c8cb Fix Module 'pytest' has no 'config' member
  • c00dd211068f60d32b6310df53b28f0e9ad391b2 Fix various dict related pylint warnings
  • dc2c71bff8915eda631ed23d0c2a7b4b3ead81da Fix raising-format-tuple
  • ec61f5de3cfcc648b1a1c3170ec7afca970f9cda Silence comparison-with-itself in tests
  • 3abfaa5754197823d2d7a1e841e3929b035e7769 Require pylint 2.1.1-2

ipa-4-7:

  • 595c8eefcb37ee1aeac64d0a0f31158df126d0e3 Ignore W504 code style like in travis config
  • 5250c1fe60a36936d54fc784bf2fcf425d1fd705 Address pylint violations in lite-server
  • 74c8ac9b29cef81f0140bdea2cf952e6b89a6848 Address inconsistent-return-statements
  • 4b0b321598b3c9a718d2fb747992db4e59d92592 Ignore consider-using-enumerate for now
  • f4f0fe24d75c54e4f5db0aeccbf0c6c5283711a2 Address consider-using-in
  • 28fb5cca455a6189f34c9246ac77e375267faeb8 Fix comparison-with-callable
  • 7ece66ba6b526c3395e2df327224708b84b7b498 Fix useless-import-alias
  • 8cce2c27860c10056322ad1a3bac01efdab0dd71 Fix Module 'pytest' has no 'config' member
  • 204032d7a9c602df90fa6e8fdacb957420e068d7 Fix various dict related pylint warnings
  • 984fd02ec6dea84b5552f43913811fd128e19c94 Fix raising-format-tuple
  • 2011a427ff141bc6a29ba7b3aea6aee0273565f5 Silence comparison-with-itself in tests
  • fdbd463352833f92bf8230c841eee2eabd00add6 Require pylint 2.1.1-2

Metadata Update from @cheimes:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

ipa-4-6:

  • cb21a71e13c629faf63ebe96a143621c16b4b087 pylint 2.2: Fix unnecessary pass statement
  • 905b40256f3527d2d8f9175ba11bcd4418638c80 pylint: Fix duplicate-string-formatting-argument
  • fa9affae0d5112d10b62aa956db78c43699ae1e1 pylint: also verify scripts
  • e959d1472052a1d576af807f62234820234382f8 Address misc pylint issues in CLI scripts
  • b7de732fd89f2df7a5838b68eff1601990901002 Address pylint violations in lite-server
  • 2ecad905c0c7f226fe7986ee2401be6a7927e7dd Address inconsistent-return-statements
  • 7b090ba382e96c9fd8075e10457f2f9e8aacd141 Fix Module 'pytest' has no 'config' member
  • 2a5114f6000cc37cff3904f229510ee5417fce93 Silence comparison-with-itself in tests
  • 42eae483e15a243a6ba1d9e9f7f828b273a3461d Ignore W504 code style like in travis config
  • 8753e2f0f9b85681e162baa3681754f6f46df0d1 Ignore consider-using-enumerate for now
  • 8185ebc734ce85ca57fc62339c00866b03ca0195 Address consider-using-in
  • 2fd773d2ff4bf60b6330f6b31a32de5d2ef7f003 Fix comparison-with-callable
  • 33a94d06647180596ec853555e3b45ef45a952dd Fix useless-import-alias
Metadata