#7326 pylint 1.8.1: inconsistent-return-statements error
Closed: fixed 6 years ago Opened 6 years ago by cheimes.

pylint 1.8.1 wars about inconsistent-return-statements, https://github.com/PyCQA/pylint/issues/1267. FreeIPA has multiple violations, which breaks pylint under tox:

Using config file /freeipa/pylintrc

************* Module ipaclient.plugins.migration

lib/python3.6/site-packages/ipaclient/plugins/migration.py:54: [R1710(inconsistent-return-statements), migrate_ds.output_for_cli] Either all return statements in a function should return an expression, or none of them should.)

************* Module ipaclient.plugins.vault

lib/python3.6/site-packages/ipaclient/plugins/vault.py:100: [R1710(inconsistent-return-statements), encrypt] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipaclient/plugins/vault.py:123: [R1710(inconsistent-return-statements), decrypt] Either all return statements in a function should return an expression, or none of them should.)

************* Module ipalib.backend

lib/python3.6/site-packages/ipalib/backend.py:137: [R1710(inconsistent-return-statements), Executioner.execute] Either all return statements in a function should return an expression, or none of them should.)

************* Module ipalib.x509

lib/python3.6/site-packages/ipalib/x509.py:276: [R1710(inconsistent-return-statements), IPACertificate.extended_key_usage_bytes] Either all return statements in a function should return an expression, or none of them should.)

************* Module ipalib.config

lib/python3.6/site-packages/ipalib/config.py:351: [R1710(inconsistent-return-statements), Env._merge_from_file] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/config.py:391: [R1710(inconsistent-return-statements), Env._join] Either all return statements in a function should return an expression, or none of them should.)

************* Module ipalib.rpc

lib/python3.6/site-packages/ipalib/rpc.py:897: [R1710(inconsistent-return-statements), RPCClient.get_session_cookie_from_persistent_storage] Either all return statements in a function should return an expression, or none of them should.)

************* Module ipalib.frontend

lib/python3.6/site-packages/ipalib/frontend.py:1005: [R1710(inconsistent-return-statements), Command.get_summary_default] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/frontend.py:1024: [R1710(inconsistent-return-statements), Command.output_for_cli] Either all return statements in a function should return an expression, or none of them should.)

************* Module ipalib.cli

lib/python3.6/site-packages/ipalib/cli.py:92: [R1710(inconsistent-return-statements), textui.get_tty_width] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/cli.py:574: [R1710(inconsistent-return-statements), textui.prompt_yesno] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/cli.py:610: [R1710(inconsistent-return-statements), textui.prompt_password] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/cli.py:1146: [R1710(inconsistent-return-statements), cli.run] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/cli.py:1250: [R1710(inconsistent-return-statements), cli.__get_arg_name] Either all return statements in a function should return an expression, or none of them should.)

************* Module ipalib.parameters

lib/python3.6/site-packages/ipalib/parameters.py:247: [R1710(inconsistent-return-statements), DefaultFrom.__call__] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/parameters.py:1133: [R1710(inconsistent-return-statements), Int._rule_minvalue] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/parameters.py:1143: [R1710(inconsistent-return-statements), Int._rule_maxvalue] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/parameters.py:1205: [R1710(inconsistent-return-statements), Decimal._rule_minvalue] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/parameters.py:1215: [R1710(inconsistent-return-statements), Decimal._rule_maxvalue] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/parameters.py:1343: [R1710(inconsistent-return-statements), Data._rule_pattern] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/parameters.py:1383: [R1710(inconsistent-return-statements), Bytes._rule_minlength] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/parameters.py:1393: [R1710(inconsistent-return-statements), Bytes._rule_maxlength] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/parameters.py:1403: [R1710(inconsistent-return-statements), Bytes._rule_length] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/parameters.py:1553: [R1710(inconsistent-return-statements), Str._rule_noextrawhitespace] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/parameters.py:1563: [R1710(inconsistent-return-statements), Str._rule_minlength] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/parameters.py:1573: [R1710(inconsistent-return-statements), Str._rule_maxlength] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/parameters.py:1583: [R1710(inconsistent-return-statements), Str._rule_length] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/parameters.py:1654: [R1710(inconsistent-return-statements), Enum._rule_values] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/parameters.py:2064: [R1710(inconsistent-return-statements), DNSNameParam._rule_only_absolute] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/parameters.py:2068: [R1710(inconsistent-return-statements), DNSNameParam._rule_only_relative] Either all return statements in a function should return an expression, or none of them should.)

************* Module ipalib.util

lib/python3.6/site-packages/ipalib/util.py:455: [R1710(inconsistent-return-statements), validate_sshpubkey] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/util.py:461: [R1710(inconsistent-return-statements), validate_sshpubkey_no_options] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipalib/util.py:695: [R1710(inconsistent-return-statements), validate_hostmask] Either all return statements in a function should return an expression, or none of them should.)

************* Module ipapython.session_storage

lib/python3.6/site-packages/ipapython/session_storage.py:271: [R1710(inconsistent-return-statements), get_data] Either all return statements in a function should return an expression, or none of them should.)

************* Module ipapython.config

lib/python3.6/site-packages/ipapython/config.py:204: [R1710(inconsistent-return-statements), __discover_config] Either all return statements in a function should return an expression, or none of them should.)

************* Module ipapython.ssh

lib/python3.6/site-packages/ipapython/ssh.py:198: [R1710(inconsistent-return-statements), SSHPublicKey._fingerprint_dns] Either all return statements in a function should return an expression, or none of them should.)

************* Module ipapython.ipautil

lib/python3.6/site-packages/ipapython/ipautil.py:196: [R1710(inconsistent-return-statements), CheckedIPAddress.get_matching_interface] Either all return statements in a function should return an expression, or none of them should.)

lib/python3.6/site-packages/ipapython/ipautil.py:930: [R1710(inconsistent-return-statements), user_input] Either all return statements in a function should return an expression, or none of them should.)

On which step in ipa you get this error
ipa-server-install or ipa-replica-install or someother

Metadata Update from @cheimes:
- Issue assigned to cheimes

6 years ago

As I wrote, it's a problem with pylint under tox. The issue occurs on our CI infrastructure and blocks the PR queue.

Reproducer:
* tox -e pylint2

Fix:
https://github.com/freeipa/freeipa/pull/1408

master:

  • 8cb756a Fix pylint warnings inconsistent-return-statements

ipa-4-6:

  • 843a59a Fix pylint warnings inconsistent-return-statements

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

6 years ago

master:

  • 1c9f0a4 Vault: Add argument checks to encrypt/decrypt

Login to comment on this ticket.

Metadata