diff options
| author | Armando Neto <abiagion@redhat.com> | 2018-07-12 11:21:34 -0300 |
|---|---|---|
| committer | Christian Heimes <cheimes@redhat.com> | 2018-07-14 12:04:19 +0200 |
| commit | d13571942e41370fdbd2b6f9960c484fa61c3404 (patch) | |
| tree | ba9ba643d9f54cf724a310086298dfbbd7aa6578 /ipapython | |
| parent | aacf185ff8eb1bf6b54e0ba893ca4e750cb69564 (diff) | |
| download | freeipa-d13571942e41370fdbd2b6f9960c484fa61c3404.tar.gz freeipa-d13571942e41370fdbd2b6f9960c484fa61c3404.tar.xz freeipa-d13571942e41370fdbd2b6f9960c484fa61c3404.zip | |
Fix Pylint 2.0 violations
Fix the following violations aiming to support Pylint 2.0
- `unneeded-not` (C0113):
Consider changing "not item in items" to "item not in items" used
when a boolean expression contains an unneeded negation.
- `useless-import-alias` (C0414):
Import alias does not rename original package Used when an import
alias is same as original package.e.g using import numpy as numpy
instead of import numpy as np
- `raising-format-tuple` (W0715):
Exception arguments suggest string formatting might be intended Used
when passing multiple arguments to an exception constructor, the
first of them a string literal containing what appears to be
placeholders intended for formatting
- `bad-continuation` (C0330):
This was already included on the disable list, although with current
version of pylint (2.0.0.dev2) violations at the end of the files
are not being ignored.
See: https://github.com/PyCQA/pylint/issues/2278
- `try-except-raise` (E0705):
The except handler raises immediately Used when an except handler
uses raise as its first or only operator. This is useless because it
raises back the exception immediately. Remove the raise operator or
the entire try-except-raise block!
- `consider-using-set-comprehension` (R1718):
Consider using a set comprehension Although there is nothing
syntactically wrong with this code, it is hard to read and can be
simplified to a set comprehension.Also it is faster since you don't
need to create another transient list
- `dict-keys-not-iterating` (W1655):
dict.keys referenced when not iterating Used when dict.keys is
referenced in a non-iterating context (returns an iterator in
Python 3)
- `comprehension-escape` (W1662):
Using a variable that was bound inside a comprehension Emitted when
using a variable, that was bound in a comprehension handler, outside
of the comprehension itself. On Python 3 these variables will be
deleted outside of the comprehension.
Issue: https://pagure.io/freeipa/issue/7614
Signed-off-by: Armando Neto <abiagion@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
Diffstat (limited to 'ipapython')
| -rw-r--r-- | ipapython/install/core.py | 2 | ||||
| -rw-r--r-- | ipapython/ipaldap.py | 9 |
2 files changed, 4 insertions, 7 deletions
diff --git a/ipapython/install/core.py b/ipapython/install/core.py index d8e04f1b1..7f638914c 100644 --- a/ipapython/install/core.py +++ b/ipapython/install/core.py @@ -310,8 +310,6 @@ class Configurable(six.with_metaclass(abc.ABCMeta, object)): prop = prop_cls(self) try: prop.validate(value) - except KnobValueError: - raise except ValueError as e: raise KnobValueError(name, str(e)) diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py index 53f8e7cbb..fbc824e60 100644 --- a/ipapython/ipaldap.py +++ b/ipapython/ipaldap.py @@ -208,11 +208,10 @@ class SchemaCache(object): info = e.args[0].get('info', '').strip() raise errors.DatabaseError(desc = u'uri=%s' % url, info = u'Unable to retrieve LDAP schema: %s: %s' % (desc, info)) - except IndexError: - # no 'cn=schema' entry in LDAP? some servers use 'cn=subschema' - # TODO: DS uses 'cn=schema', support for other server? - # raise a more appropriate exception - raise + + # no 'cn=schema' entry in LDAP? some servers use 'cn=subschema' + # TODO: DS uses 'cn=schema', support for other server? + # raise a more appropriate exception return ldap.schema.SubSchema(schema_entry[1]) |
