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