|
|
403b09 |
From a23b8fd488ca33f3e6ffa42530debd6d5d3430ac Mon Sep 17 00:00:00 2001
|
|
|
403b09 |
From: Jan Cholasta <jcholast@redhat.com>
|
|
|
403b09 |
Date: Mon, 18 Jul 2016 09:37:24 +0200
|
|
|
403b09 |
Subject: [PATCH] client: fix hiding of commands which lack server support
|
|
|
403b09 |
|
|
|
403b09 |
Rather than checking the server counterpart's NO_CLI, which may be False
|
|
|
403b09 |
even for commands supported on the server, check wheter the server
|
|
|
403b09 |
counterpart is a command defined on the server or a local placeholder.
|
|
|
403b09 |
|
|
|
403b09 |
https://fedorahosted.org/freeipa/ticket/6089
|
|
|
403b09 |
|
|
|
403b09 |
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
|
|
|
403b09 |
---
|
|
|
403b09 |
ipaclient/plugins/automount.py | 3 ++-
|
|
|
403b09 |
ipaclient/plugins/otptoken_yubikey.py | 3 ++-
|
|
|
403b09 |
ipaclient/plugins/vault.py | 12 ++++++++----
|
|
|
403b09 |
3 files changed, 12 insertions(+), 6 deletions(-)
|
|
|
403b09 |
|
|
|
403b09 |
diff --git a/ipaclient/plugins/automount.py b/ipaclient/plugins/automount.py
|
|
|
403b09 |
index 8405f9f4fe283d9c068d51e10717fb1396fa44bf..c6537bc6c24b905a8e1f7fb6a7e2c931b95374c7 100644
|
|
|
403b09 |
--- a/ipaclient/plugins/automount.py
|
|
|
403b09 |
+++ b/ipaclient/plugins/automount.py
|
|
|
403b09 |
@@ -54,7 +54,8 @@ class _fake_automountlocation_show(Method):
|
|
|
403b09 |
class automountlocation_tofiles(MethodOverride):
|
|
|
403b09 |
@property
|
|
|
403b09 |
def NO_CLI(self):
|
|
|
403b09 |
- return self.api.Command.automountlocation_show.NO_CLI
|
|
|
403b09 |
+ return isinstance(self.api.Command.automountlocation_show,
|
|
|
403b09 |
+ _fake_automountlocation_show)
|
|
|
403b09 |
|
|
|
403b09 |
def output_for_cli(self, textui, result, *keys, **options):
|
|
|
403b09 |
maps = result['result']['maps']
|
|
|
403b09 |
diff --git a/ipaclient/plugins/otptoken_yubikey.py b/ipaclient/plugins/otptoken_yubikey.py
|
|
|
403b09 |
index 5e0d994628ab997853a80d1f1118ba8ada9993d9..423b670de15dd7f803db1dcbb759bd0254827072 100644
|
|
|
403b09 |
--- a/ipaclient/plugins/otptoken_yubikey.py
|
|
|
403b09 |
+++ b/ipaclient/plugins/otptoken_yubikey.py
|
|
|
403b09 |
@@ -76,7 +76,8 @@ class otptoken_add_yubikey(Command):
|
|
|
403b09 |
|
|
|
403b09 |
@property
|
|
|
403b09 |
def NO_CLI(self):
|
|
|
403b09 |
- return self.api.Command.otptoken_add.NO_CLI
|
|
|
403b09 |
+ return isinstance(self.api.Command.otptoken_add,
|
|
|
403b09 |
+ _fake_otptoken_add)
|
|
|
403b09 |
|
|
|
403b09 |
def get_args(self):
|
|
|
403b09 |
for arg in self.api.Command.otptoken_add.args():
|
|
|
403b09 |
diff --git a/ipaclient/plugins/vault.py b/ipaclient/plugins/vault.py
|
|
|
403b09 |
index b7e0cfffb2fff62fdbbf438964d124fc2dd8ac36..e3a1ae3a0ad767bcee843b7fa3743a934e02d18b 100644
|
|
|
403b09 |
--- a/ipaclient/plugins/vault.py
|
|
|
403b09 |
+++ b/ipaclient/plugins/vault.py
|
|
|
403b09 |
@@ -204,7 +204,8 @@ class vault_add(Local):
|
|
|
403b09 |
|
|
|
403b09 |
@property
|
|
|
403b09 |
def NO_CLI(self):
|
|
|
403b09 |
- return self.api.Command.vault_add_internal.NO_CLI
|
|
|
403b09 |
+ return isinstance(self.api.Command.vault_add_internal,
|
|
|
403b09 |
+ _fake_vault_add_internal)
|
|
|
403b09 |
|
|
|
403b09 |
def get_args(self):
|
|
|
403b09 |
for arg in self.api.Command.vault_add_internal.args():
|
|
|
403b09 |
@@ -401,7 +402,8 @@ class vault_mod(Local):
|
|
|
403b09 |
|
|
|
403b09 |
@property
|
|
|
403b09 |
def NO_CLI(self):
|
|
|
403b09 |
- return self.api.Command.vault_mod_internal.NO_CLI
|
|
|
403b09 |
+ return isinstance(self.api.Command.vault_mod_internal,
|
|
|
403b09 |
+ _fake_vault_mod_internal)
|
|
|
403b09 |
|
|
|
403b09 |
def get_args(self):
|
|
|
403b09 |
for arg in self.api.Command.vault_mod_internal.args():
|
|
|
403b09 |
@@ -579,7 +581,8 @@ class vault_archive(Local):
|
|
|
403b09 |
|
|
|
403b09 |
@property
|
|
|
403b09 |
def NO_CLI(self):
|
|
|
403b09 |
- return self.api.Command.vault_archive_internal.NO_CLI
|
|
|
403b09 |
+ return isinstance(self.api.Command.vault_archive_internal,
|
|
|
403b09 |
+ _fake_vault_archive_internal)
|
|
|
403b09 |
|
|
|
403b09 |
def get_args(self):
|
|
|
403b09 |
for arg in self.api.Command.vault_archive_internal.args():
|
|
|
403b09 |
@@ -827,7 +830,8 @@ class vault_retrieve(Local):
|
|
|
403b09 |
|
|
|
403b09 |
@property
|
|
|
403b09 |
def NO_CLI(self):
|
|
|
403b09 |
- return self.api.Command.vault_retrieve_internal.NO_CLI
|
|
|
403b09 |
+ return isinstance(self.api.Command.vault_retrieve_internal,
|
|
|
403b09 |
+ _fake_vault_retrieve_internal)
|
|
|
403b09 |
|
|
|
403b09 |
def get_args(self):
|
|
|
403b09 |
for arg in self.api.Command.vault_retrieve_internal.args():
|
|
|
403b09 |
--
|
|
|
403b09 |
2.7.4
|
|
|
403b09 |
|