Hi,

the attached patches fix <https://fedorahosted.org/freeipa/ticket/6089>.

Honza

--
Jan Cholasta
From b6d02e58b105a3a30561dd83fbe67ba59ac2a315 Mon Sep 17 00:00:00 2001
From: Jan Cholasta <jchol...@redhat.com>
Date: Mon, 25 Jul 2016 14:00:08 +0200
Subject: [PATCH 1/2] Revert "Enable vault-* commands on client"

This reverts commit 9feeaca9fb552229638ce98086aa75905a45b48d.

https://fedorahosted.org/freeipa/ticket/6089
---
 ipaclient/plugins/vault.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/ipaclient/plugins/vault.py b/ipaclient/plugins/vault.py
index a3ce6fe..b7e0cff 100644
--- a/ipaclient/plugins/vault.py
+++ b/ipaclient/plugins/vault.py
@@ -202,6 +202,10 @@ class vault_add(Local):
         ),
     )
 
+    @property
+    def NO_CLI(self):
+        return self.api.Command.vault_add_internal.NO_CLI
+
     def get_args(self):
         for arg in self.api.Command.vault_add_internal.args():
             yield arg
@@ -395,6 +399,10 @@ class vault_mod(Local):
         ),
     )
 
+    @property
+    def NO_CLI(self):
+        return self.api.Command.vault_mod_internal.NO_CLI
+
     def get_args(self):
         for arg in self.api.Command.vault_mod_internal.args():
             yield arg
@@ -569,6 +577,10 @@ class vault_archive(Local):
         ),
     )
 
+    @property
+    def NO_CLI(self):
+        return self.api.Command.vault_archive_internal.NO_CLI
+
     def get_args(self):
         for arg in self.api.Command.vault_archive_internal.args():
             yield arg
@@ -813,6 +825,10 @@ class vault_retrieve(Local):
         ),
     )
 
+    @property
+    def NO_CLI(self):
+        return self.api.Command.vault_retrieve_internal.NO_CLI
+
     def get_args(self):
         for arg in self.api.Command.vault_retrieve_internal.args():
             yield arg
-- 
2.7.4

From 17f704f43667914b10907537880f34a0aa370037 Mon Sep 17 00:00:00 2001
From: Jan Cholasta <jchol...@redhat.com>
Date: Mon, 18 Jul 2016 09:37:24 +0200
Subject: [PATCH 2/2] 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
---
 ipaclient/plugins/automount.py        |  3 ++-
 ipaclient/plugins/otptoken_yubikey.py |  3 ++-
 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 8405f9f..c6537bc 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 5e0d994..423b670 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 b7e0cff..e3a1ae3 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():
-- 
2.7.4

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to