diff options
author | Jan Cholasta <jcholast@redhat.com> | 2016-07-18 09:37:24 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2016-07-28 10:24:45 +0200 |
commit | f563d982f2331456feadb5f961b7883d28348211 (patch) | |
tree | df35eef84fa5e83248f9b8cd5029416cafe596ca /ipaclient | |
parent | ea62f2745d60aaed950ce9e5611d6c0ff1b8c8af (diff) | |
download | freeipa-f563d982f2331456feadb5f961b7883d28348211.tar.gz freeipa-f563d982f2331456feadb5f961b7883d28348211.tar.xz freeipa-f563d982f2331456feadb5f961b7883d28348211.zip |
client: fix hiding of commands which lack server support
Rather than checking the server counterpart's NO_CLI, which may be False
even for commands supported on the server, check wheter the server
counterpart is a command defined on the server or a local placeholder.
https://fedorahosted.org/freeipa/ticket/6089
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
Diffstat (limited to 'ipaclient')
-rw-r--r-- | ipaclient/plugins/automount.py | 3 | ||||
-rw-r--r-- | ipaclient/plugins/otptoken_yubikey.py | 3 | ||||
-rw-r--r-- | ipaclient/plugins/vault.py | 12 |
3 files changed, 12 insertions, 6 deletions
diff --git a/ipaclient/plugins/automount.py b/ipaclient/plugins/automount.py index 8405f9f4f..c6537bc6c 100644 --- a/ipaclient/plugins/automount.py +++ b/ipaclient/plugins/automount.py @@ -54,7 +54,8 @@ class _fake_automountlocation_show(Method): class automountlocation_tofiles(MethodOverride): @property def NO_CLI(self): - return self.api.Command.automountlocation_show.NO_CLI + return isinstance(self.api.Command.automountlocation_show, + _fake_automountlocation_show) def output_for_cli(self, textui, result, *keys, **options): maps = result['result']['maps'] diff --git a/ipaclient/plugins/otptoken_yubikey.py b/ipaclient/plugins/otptoken_yubikey.py index 5e0d99462..423b670de 100644 --- a/ipaclient/plugins/otptoken_yubikey.py +++ b/ipaclient/plugins/otptoken_yubikey.py @@ -76,7 +76,8 @@ class otptoken_add_yubikey(Command): @property def NO_CLI(self): - return self.api.Command.otptoken_add.NO_CLI + return isinstance(self.api.Command.otptoken_add, + _fake_otptoken_add) def get_args(self): for arg in self.api.Command.otptoken_add.args(): diff --git a/ipaclient/plugins/vault.py b/ipaclient/plugins/vault.py index b7e0cfffb..e3a1ae3a0 100644 --- a/ipaclient/plugins/vault.py +++ b/ipaclient/plugins/vault.py @@ -204,7 +204,8 @@ class vault_add(Local): @property def NO_CLI(self): - return self.api.Command.vault_add_internal.NO_CLI + return isinstance(self.api.Command.vault_add_internal, + _fake_vault_add_internal) def get_args(self): for arg in self.api.Command.vault_add_internal.args(): @@ -401,7 +402,8 @@ class vault_mod(Local): @property def NO_CLI(self): - return self.api.Command.vault_mod_internal.NO_CLI + return isinstance(self.api.Command.vault_mod_internal, + _fake_vault_mod_internal) def get_args(self): for arg in self.api.Command.vault_mod_internal.args(): @@ -579,7 +581,8 @@ class vault_archive(Local): @property def NO_CLI(self): - return self.api.Command.vault_archive_internal.NO_CLI + return isinstance(self.api.Command.vault_archive_internal, + _fake_vault_archive_internal) def get_args(self): for arg in self.api.Command.vault_archive_internal.args(): @@ -827,7 +830,8 @@ class vault_retrieve(Local): @property def NO_CLI(self): - return self.api.Command.vault_retrieve_internal.NO_CLI + return isinstance(self.api.Command.vault_retrieve_internal, + _fake_vault_retrieve_internal) def get_args(self): for arg in self.api.Command.vault_retrieve_internal.args(): |