From 71cce80f1f54da76766af4105211608bd50ab44d Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 13 Feb 2014 12:32:58 +0100 Subject: core: suppress error message ZONE_ALREADY_SET when adding firewalld zone See also https://bugzilla.redhat.com/show_bug.cgi?id=886432, where firewalld was changed, not to return ZONE_ALREADY_SET for 'changeZone'. However, 'addInterface' can still fail with this error. Suppress the following error lines: [1392290031.179280] [firewall-manager/nm-firewall-manager.c:117] nm_firewall_manager_add_or_change_zone(): (em1) firewall zone add -> (null) ... (em1) firewall zone add/change failed: (32) ZONE_ALREADY_SET Signed-off-by: Thomas Haller --- src/firewall-manager/nm-firewall-manager.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/firewall-manager/nm-firewall-manager.c b/src/firewall-manager/nm-firewall-manager.c index d73069fca6..ffe0649a1e 100644 --- a/src/firewall-manager/nm-firewall-manager.c +++ b/src/firewall-manager/nm-firewall-manager.c @@ -82,8 +82,13 @@ add_or_change_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data G_TYPE_STRING, &zone, G_TYPE_INVALID)) { g_assert (error); - nm_log_warn (LOGD_FIREWALL, "(%s) firewall zone add/change failed: (%d) %s", - info->iface, error->code, error->message); + if (g_strcmp0 (error->message, "ZONE_ALREADY_SET") != 0) { + nm_log_warn (LOGD_FIREWALL, "(%s) firewall zone add/change failed: (%d) %s", + info->iface, error->code, error->message); + } else { + nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone add/change failed: (%d) %s", + info->iface, error->code, error->message); + } } info->callback (error, info->user_data); @@ -114,7 +119,8 @@ nm_firewall_manager_add_or_change_zone (NMFirewallManager *self, info->callback = callback; info->user_data = user_data; - nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone %s -> %s", iface, add ? "add" : "change", zone); + nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone %s -> %s%s%s", iface, add ? "add" : "change", + zone?"\"":"", zone ? zone : "default", zone?"\"":""); return dbus_g_proxy_begin_call_with_timeout (priv->proxy, add ? "addInterface" : "changeZone", add_or_change_cb, -- cgit v1.2.1