diff options
author | Tomas Babej <tbabej@redhat.com> | 2014-12-12 16:47:49 +0100 |
---|---|---|
committer | Tomas Babej <tbabej@redhat.com> | 2014-12-12 17:04:21 +0100 |
commit | c5c9d49706d27455c7f7bdb811108d45deb82bf4 (patch) | |
tree | b1de5835613280b9d69187345c756aa8f3a998b6 /ipalib | |
parent | fdd7b79eeafae3891a9aa5bf414f9c65f947e88d (diff) | |
download | freeipa-c5c9d49706d27455c7f7bdb811108d45deb82bf4.tar.gz freeipa-c5c9d49706d27455c7f7bdb811108d45deb82bf4.tar.xz freeipa-c5c9d49706d27455c7f7bdb811108d45deb82bf4.zip |
idviews: Ignore host or hostgroup options set to None
Since passing --hosts= or --hostsgroups= to idview-apply or unapply
commands does not make sense, ignore it.
https://fedorahosted.org/freeipa/ticket/4806
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/plugins/idviews.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ipalib/plugins/idviews.py b/ipalib/plugins/idviews.py index c9c1bd848..df6b80fee 100644 --- a/ipalib/plugins/idviews.py +++ b/ipalib/plugins/idviews.py @@ -253,6 +253,12 @@ class baseidview_apply(LDAPQuery): 'hostgroup': [], } + # Make sure we ignore None passed via host or hostgroup, since it does + # not make sense + for key in ('host', 'hostgroup'): + if key in options and options[key] is None: + del options[key] + # Generate a list of all hosts to apply the view to hosts_to_apply = list(options.get('host', [])) |