New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ipa help doesn't always work #701
Conversation
Signed-off-by: David Kreitschmann <david@kreitschmann.de>
|
@neffs please fix pylint error reported in Travis CI: ************* Module ipaclient.remote_plugins.schema
ipaclient/remote_plugins/schema.py:519: [E1101(no-member), Schema.get_help] Instance of 'dict' has no 'decode' member)
make: *** [pylint] Error 2
Makefile:1175: recipe for target 'pylint' failed |
|
@martbab if isinstance(self._help, bytes):
self._help = json.loads(self._help.decode('utf-8'))maybe we can trick it with a change like this (similar to read_namespace_member): value = self._help
if isinstance(value, bytes):
self._help = json.loads(value.decode('utf-8')) |
|
@martbab I pushed this additional change but pylint still reports this error which is clearly wrong because the line is only executed if it is an instance of bytes. Could you please provide some directions? |
|
@neffs Hi, thanks for the patch. As for the pylint issue it happens sometimes that pylint gets confused even in situations that seems perfectly clear. This will be probably the case because it complains about member of dict instance in branch when it's guaranteed to be bytes instance. I propose following "fix". Just tell pylint to don't worry about this case. if isinstance(self._help, bytes):
self._help = json.loads(
self._help.decode('utf-8') # pylint: disable=no-member
) |
|
@neffs Thanks for the fix. Could you please drop the second commit ("Fix pylint error in get_help function"), rebase and force-push? The commit gets completely reverted in the third one so it has no value. |
|
Works for me, thanks. (Sorry for the close/reopen, it's too early in the morning here :-) |
ipa helpwill not work when calling it when no schema is cached.