From fdd7b79eeafae3891a9aa5bf414f9c65f947e88d Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Thu, 11 Dec 2014 07:50:40 +0100 Subject: 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 Reviewed-By: Petr Vobornik --- ipalib/plugins/idviews.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ipalib/plugins/idviews.py') 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))) -- cgit