mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 01:20:07 +01:00
nmcli/monitor: always print running status on monitor startup
Previously we'd note if NM is stopped, but not if it's running. I suppose it's nice for the user to know that the monitor started running, but, it's also important for the monitor to be testable (so that we know that we are ready to start adding mock objects, etc.) This also gets rids of some duplication at expense of a little less nuanced message.
This commit is contained in:
parent
777f31436c
commit
fe2eddd67c
1 changed files with 2 additions and 10 deletions
|
|
@ -1233,7 +1233,7 @@ networkmanager_running(NMClient *client, GParamSpec *param, NmCli *nmc)
|
|||
running = nm_client_get_nm_running(client);
|
||||
str = nmc_colorize(&nmc->nmc_config,
|
||||
running ? NM_META_COLOR_MANAGER_RUNNING : NM_META_COLOR_MANAGER_STOPPED,
|
||||
running ? _("NetworkManager has started") : _("NetworkManager has stopped"));
|
||||
running ? _("NetworkManager is running") : _("NetworkManager is stopped"));
|
||||
g_print("%s\n", str);
|
||||
g_free(str);
|
||||
}
|
||||
|
|
@ -1613,15 +1613,7 @@ nmc_command_func_monitor(const NMCCommand *cmd, NmCli *nmc, int argc, const char
|
|||
return;
|
||||
}
|
||||
|
||||
if (!nm_client_get_nm_running(nmc->client)) {
|
||||
char *str;
|
||||
|
||||
str = nmc_colorize(&nmc->nmc_config,
|
||||
NM_META_COLOR_MANAGER_STOPPED,
|
||||
_("Networkmanager is not running (waiting for it)\n"));
|
||||
g_print("%s", str);
|
||||
g_free(str);
|
||||
}
|
||||
networkmanager_running(nmc->client, NULL, nmc);
|
||||
|
||||
g_signal_connect(nmc->client,
|
||||
"notify::" NM_CLIENT_NM_RUNNING,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue