diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-05-31 16:08:31 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-06-04 08:37:04 +0200 |
commit | 8210a61ad5ad50315673b9b8229dab129fd11ebe (patch) | |
tree | 924294f458ea1c3c7753ff2c65306d5e2bcdf53a /src/network/networkctl.c | |
parent | cpu-set-util: use %d-%d format in cpu_set_to_range_string() only for actual ... (diff) | |
download | systemd-8210a61ad5ad50315673b9b8229dab129fd11ebe.tar.xz systemd-8210a61ad5ad50315673b9b8229dab129fd11ebe.zip |
networkctl: log quietly if we fail to get bit rates
If we query older networked, they will be missing. This is not an error.
Also, make the error more informative, because the bus error itself might
be just "Unknown interface or property" which is not enough to understand
what is going on.
Diffstat (limited to 'src/network/networkctl.c')
-rw-r--r-- | src/network/networkctl.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/network/networkctl.c b/src/network/networkctl.c index 9c23672ffd..713c0cde0e 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -222,9 +222,11 @@ static int acquire_link_bitrates(sd_bus *bus, LinkInfo *link) { "org.freedesktop.network1.Link", "BitRates"); if (r < 0) { - if (sd_bus_error_has_name(&error, BUS_ERROR_SPEED_METER_INACTIVE)) - return 0; - return log_error_errno(r, "%s", bus_error_message(&error, r)); + bool quiet = sd_bus_error_has_name(&error, SD_BUS_ERROR_UNKNOWN_PROPERTY) || + sd_bus_error_has_name(&error, BUS_ERROR_SPEED_METER_INACTIVE); + + return log_full_errno(quiet ? LOG_DEBUG : LOG_WARNING, + r, "Failed to query link bit rates: %s", bus_error_message(&error, r)); } r = sd_bus_message_enter_container(reply, 'v', "(dd)"); |