Hi,

The host-del command did not accept --continue option, since the
takes_options was overriden and did not take the options from LDAPDelete.

Fix the behaviour.

https://fedorahosted.org/freeipa/ticket/4473

-- 
Tomas Babej
Associate Software Engineer | Red Hat | Identity Management
RHCE | Brno Site | IRC: tbabej | freeipa.org 


>From b38301078116b2fb9bbefcb2875ce1a600e37de8 Mon Sep 17 00:00:00 2001
From: Tomas Babej <tba...@redhat.com>
Date: Tue, 5 Aug 2014 09:12:24 +0200
Subject: [PATCH] ipalib: host_del: Extend LDAPDelete's takes_options instead
 of overriding

The host-del command did not accept --continue option, since the
takes_options was overriden and did not take the options from LDAPDelete.

Fix the behaviour.

https://fedorahosted.org/freeipa/ticket/4473
---
 API.txt                                  | 3 ++-
 ipalib/plugins/host.py                   | 2 +-
 ipatests/test_xmlrpc/test_host_plugin.py | 5 +----
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/API.txt b/API.txt
index 1243fefa7d37b34ac3dd0fac3df8820142c9f2c7..09464dbe2bc9fb7fa22a91879dc957da92aadc8f 100644
--- a/API.txt
+++ b/API.txt
@@ -1820,8 +1820,9 @@ output: Output('completed', <type 'int'>, None)
 output: Output('failed', <type 'dict'>, None)
 output: Entry('result', <type 'dict'>, Gettext('A dictionary representing an LDAP entry', domain='ipa', localedir=None))
 command: host_del
-args: 1,2,3
+args: 1,3,3
 arg: Str('fqdn', attribute=True, cli_name='hostname', multivalue=True, primary_key=True, query=True, required=True)
+option: Flag('continue', autofill=True, cli_name='continue', default=False)
 option: Flag('updatedns?', autofill=True, default=False)
 option: Str('version?', exclude='webui')
 output: Output('result', <type 'dict'>, None)
diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py
index 4ec788d38ead1b987e94d5a68c14163d4dec2ea7..bbee09395dc55730d400944729a5bed48670f785 100644
--- a/ipalib/plugins/host.py
+++ b/ipalib/plugins/host.py
@@ -650,7 +650,7 @@ class host_del(LDAPDelete):
     msg_summary = _('Deleted host "%(value)s"')
     member_attributes = ['managedby']
 
-    takes_options = (
+    takes_options = LDAPDelete.takes_options + (
         Flag('updatedns?',
             doc=_('Remove entries from DNS'),
             default=False,
diff --git a/ipatests/test_xmlrpc/test_host_plugin.py b/ipatests/test_xmlrpc/test_host_plugin.py
index a98fed1b64853e548d489f1bc12d012d18f986a7..7c0312bae5e9e652085aac8f1970610044504281 100644
--- a/ipatests/test_xmlrpc/test_host_plugin.py
+++ b/ipatests/test_xmlrpc/test_host_plugin.py
@@ -139,10 +139,7 @@ sshpubkeyfp = u'13:67:6B:BF:4E:A2:05:8E:AE:25:8B:A1:31:DE:6F:1B public key test
 class test_host(Declarative):
 
     cleanup_commands = [
-        ('host_del', [fqdn1], {}),
-        ('host_del', [fqdn2], {}),
-        ('host_del', [fqdn3], {}),
-        ('host_del', [fqdn4], {}),
+        ('host_del', [fqdn1, fqdn2, fqdn3, fqdn4], {'continue': True}),
         ('service_del', [service1], {}),
     ]
 
-- 
1.9.3

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to