Blob Blame History Raw
From c396b2318b6c673bde652421a0d0d716b78c8c23 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Sun, 22 Apr 2012 15:22:52 +0200
Subject: [PATCH] transaction: downgrade warnings about masked units (cherry
 picked from commit
 59e132a7f416d7c4a33a46d791f250e03d2c2cd0)

---
 src/transaction.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/transaction.c b/src/transaction.c
index 4f1e5cc..cda08c8 100644
--- a/src/transaction.c
+++ b/src/transaction.c
@@ -822,7 +822,7 @@ int transaction_add_job_and_dependencies(
 
         if (type != JOB_STOP && unit->load_state == UNIT_MASKED) {
                 dbus_set_error(e, BUS_ERROR_MASKED, "Unit %s is masked.", unit->id);
-                return -EINVAL;
+                return -EADDRNOTAVAIL;
         }
 
         if (!unit_job_is_applicable(unit, type)) {
@@ -893,7 +893,8 @@ int transaction_add_job_and_dependencies(
                         SET_FOREACH(dep, ret->unit->dependencies[UNIT_REQUIRES_OVERRIDABLE], i) {
                                 r = transaction_add_job_and_dependencies(tr, JOB_START, dep, ret, !override, override, false, false, ignore_order, e);
                                 if (r < 0) {
-                                        log_warning("Cannot add dependency job for unit %s, ignoring: %s", dep->id, bus_error(e, r));
+                                        log_full(r == -EADDRNOTAVAIL ? LOG_DEBUG : LOG_WARNING,
+                                                 "Cannot add dependency job for unit %s, ignoring: %s", dep->id, bus_error(e, r));
 
                                         if (e)
                                                 dbus_error_free(e);
@@ -903,7 +904,8 @@ int transaction_add_job_and_dependencies(
                         SET_FOREACH(dep, ret->unit->dependencies[UNIT_WANTS], i) {
                                 r = transaction_add_job_and_dependencies(tr, JOB_START, dep, ret, false, false, false, false, ignore_order, e);
                                 if (r < 0) {
-                                        log_warning("Cannot add dependency job for unit %s, ignoring: %s", dep->id, bus_error(e, r));
+                                        log_full(r == -EADDRNOTAVAIL ? LOG_DEBUG : LOG_WARNING,
+                                                 "Cannot add dependency job for unit %s, ignoring: %s", dep->id, bus_error(e, r));
 
                                         if (e)
                                                 dbus_error_free(e);
@@ -924,7 +926,8 @@ int transaction_add_job_and_dependencies(
                         SET_FOREACH(dep, ret->unit->dependencies[UNIT_REQUISITE_OVERRIDABLE], i) {
                                 r = transaction_add_job_and_dependencies(tr, JOB_VERIFY_ACTIVE, dep, ret, !override, override, false, false, ignore_order, e);
                                 if (r < 0) {
-                                        log_warning("Cannot add dependency job for unit %s, ignoring: %s", dep->id, bus_error(e, r));
+                                        log_full(r == -EADDRNOTAVAIL ? LOG_DEBUG : LOG_WARNING,
+                                                 "Cannot add dependency job for unit %s, ignoring: %s", dep->id, bus_error(e, r));
 
                                         if (e)
                                                 dbus_error_free(e);