937546
From 6672b67ee145db6ed368b50a49bec00f49eccf91 Mon Sep 17 00:00:00 2001
937546
From: Rob Crittenden <rcritten@redhat.com>
937546
Date: Thu, 1 Aug 2019 13:53:44 -0400
937546
Subject: [PATCH] Don't return SSH keys with ipa host-find --pkey-only
937546
937546
This was introduced in 14ee02dcbd6cbb6c221ac7526e471a9fc58fcc82
937546
937546
https://pagure.io/freeipa/issue/8029
937546
937546
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
937546
---
937546
 ipaserver/plugins/host.py | 3 ++-
937546
 1 file changed, 2 insertions(+), 1 deletion(-)
937546
937546
diff --git a/ipaserver/plugins/host.py b/ipaserver/plugins/host.py
937546
index c74a3e58f8af6b33e284ba54b5763a684d91bac3..d6172599d30ec0b2c7b475e59dec22e111e79328 100644
937546
--- a/ipaserver/plugins/host.py
937546
+++ b/ipaserver/plugins/host.py
937546
@@ -1050,7 +1050,8 @@ class host_find(LDAPSearch):
937546
                         (filter, hosts_filter), ldap.MATCH_ALL
937546
                     )
937546
 
937546
-        add_sshpubkey_to_attrs_pre(self.context, attrs_list)
937546
+        if not options.get('pkey_only', False):
937546
+            add_sshpubkey_to_attrs_pre(self.context, attrs_list)
937546
 
937546
         return (filter.replace('locality', 'l'), base_dn, scope)
937546
 
937546
-- 
937546
2.20.1
937546