diff options
author | David Kupka <dkupka@redhat.com> | 2016-12-06 12:35:23 +0100 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-12-14 11:50:35 +0100 |
commit | d841a79dc104521f736469eff7154c2f4266082b (patch) | |
tree | 439864a2331d34b9cbf603f5dc215485e11bd98b /ipaclient/plugins | |
parent | 19aba7c555edf065b9f2fa95142da81b92396264 (diff) | |
download | freeipa-d841a79dc104521f736469eff7154c2f4266082b.tar.gz freeipa-d841a79dc104521f736469eff7154c2f4266082b.tar.xz freeipa-d841a79dc104521f736469eff7154c2f4266082b.zip |
ipaclient.plugins: Use api_version from internally called commands
In client plugins make sure the api_version is 'inherited' from server command
that is internally called. Otherwise the api_version is obtained from client
API instance. When calling server command from client command 'version' is
passed in options and it overrides the right one. Server then refuses to handle
such call.
https://fedorahosted.org/freeipa/ticket/6539
Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipaclient/plugins')
-rw-r--r-- | ipaclient/plugins/automount.py | 4 | ||||
-rw-r--r-- | ipaclient/plugins/otptoken_yubikey.py | 4 | ||||
-rw-r--r-- | ipaclient/plugins/vault.py | 16 |
3 files changed, 24 insertions, 0 deletions
diff --git a/ipaclient/plugins/automount.py b/ipaclient/plugins/automount.py index 540bd5910..650c74854 100644 --- a/ipaclient/plugins/automount.py +++ b/ipaclient/plugins/automount.py @@ -60,6 +60,10 @@ class automountlocation_tofiles(MethodOverride): NO_CLI = classproperty(__NO_CLI_getter) + @property + def api_version(self): + return self.api.Command.automountlocation_show.api_version + def output_for_cli(self, textui, result, *keys, **options): maps = result['result']['maps'] keys = result['result']['keys'] diff --git a/ipaclient/plugins/otptoken_yubikey.py b/ipaclient/plugins/otptoken_yubikey.py index 1075b6d83..759b72268 100644 --- a/ipaclient/plugins/otptoken_yubikey.py +++ b/ipaclient/plugins/otptoken_yubikey.py @@ -81,6 +81,10 @@ class otptoken_add_yubikey(Command): NO_CLI = classproperty(__NO_CLI_getter) + @property + def api_version(self): + return self.api.Command.otptoken_add.api_version + def get_args(self): for arg in self.api.Command.otptoken_add.args(): yield arg diff --git a/ipaclient/plugins/vault.py b/ipaclient/plugins/vault.py index c099e9ee2..29157c7e1 100644 --- a/ipaclient/plugins/vault.py +++ b/ipaclient/plugins/vault.py @@ -209,6 +209,10 @@ class vault_add(Local): NO_CLI = classproperty(__NO_CLI_getter) + @property + def api_version(self): + return self.api.Command.vault_add_internal.api_version + def get_args(self): for arg in self.api.Command.vault_add_internal.args(): yield arg @@ -415,6 +419,10 @@ class vault_mod(Local): NO_CLI = classproperty(__NO_CLI_getter) + @property + def api_version(self): + return self.api.Command.vault_mod_internal.api_version + def get_args(self): for arg in self.api.Command.vault_mod_internal.args(): yield arg @@ -602,6 +610,10 @@ class vault_archive(Local): NO_CLI = classproperty(__NO_CLI_getter) + @property + def api_version(self): + return self.api.Command.vault_archive_internal.api_version + def get_args(self): for arg in self.api.Command.vault_archive_internal.args(): yield arg @@ -855,6 +867,10 @@ class vault_retrieve(Local): NO_CLI = classproperty(__NO_CLI_getter) + @property + def api_version(self): + return self.api.Command.vault_retrieve_internal.api_version + def get_args(self): for arg in self.api.Command.vault_retrieve_internal.args(): yield arg |