diff options
author | Tomas Babej <tbabej@redhat.com> | 2014-12-11 07:50:40 +0100 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2014-12-12 16:43:23 +0100 |
commit | fdd7b79eeafae3891a9aa5bf414f9c65f947e88d (patch) | |
tree | 555c37dc70a7ad2bf209fad71100d93c231fd1ad /ipalib/plugins/idviews.py | |
parent | 4b367bc9a732cd2ab5faf5206aa577e6a33a2f59 (diff) | |
download | freeipa-fdd7b79eeafae3891a9aa5bf414f9c65f947e88d.tar.gz freeipa-fdd7b79eeafae3891a9aa5bf414f9c65f947e88d.tar.xz freeipa-fdd7b79eeafae3891a9aa5bf414f9c65f947e88d.zip |
idviews: Complain if host is already assigned the ID View in idview-apply
When running a idview-apply command, the hosts that were already assigned
the desired view were silently ignored. Make sure such hosts show up in
the list of failed hosts.
https://fedorahosted.org/freeipa/ticket/4743
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
Diffstat (limited to 'ipalib/plugins/idviews.py')
-rw-r--r-- | ipalib/plugins/idviews.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ipalib/plugins/idviews.py b/ipalib/plugins/idviews.py index 9c8721018..c9c1bd848 100644 --- a/ipalib/plugins/idviews.py +++ b/ipalib/plugins/idviews.py @@ -260,7 +260,7 @@ class baseidview_apply(LDAPQuery): try: hosts_to_apply += get_complete_hostgroup_member_list(hostgroup) except errors.NotFound: - failed['hostgroup'].append((hostgroup, "not found")) + failed['hostgroup'].append((hostgroup, unicode(_("not found")))) except errors.PublicError as e: failed['hostgroup'].append((hostgroup, "%s : %s" % ( e.__class__.__name__, str(e)))) @@ -279,10 +279,11 @@ class baseidview_apply(LDAPQuery): completed = completed + 1 succeeded['host'].append(host) except errors.EmptyModlist: - # If view was already applied, do not complain - pass + # If view was already applied, complain about it + failed['host'].append((host, + unicode(_("ID View already applied")))) except errors.NotFound: - failed['host'].append((host, "not found")) + failed['host'].append((host, unicode(_("not found")))) except errors.PublicError as e: failed['host'].append((host, str(e))) |