diff options
author | Thomas Haller <thaller@redhat.com> | 2019-12-11 11:48:25 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-12-11 11:52:05 +0100 |
commit | fd8c8ffe0d674beed69c910b7566cabdea8896ad (patch) | |
tree | 6df3714f82aa2981a46326d3c5951250e35c2076 | |
parent | 8f96d3cb0c40ef19ab6524a39eeae9b03da1b4f3 (diff) | |
download | NetworkManager-fd8c8ffe0d674beed69c910b7566cabdea8896ad.tar.gz |
config: print config warnings during `NetworkManager --print-config`
-rw-r--r-- | src/main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c index b1466c1852..262b64841f 100644 --- a/src/main.c +++ b/src/main.c @@ -154,6 +154,7 @@ print_config (NMConfigCmdLineOptions *config_cli) gs_unref_object NMConfig *config = NULL; gs_free_error GError *error = NULL; NMConfigData *config_data; + const char *const*warnings; nm_logging_setup ("OFF", "ALL", NULL, NULL); @@ -166,6 +167,13 @@ print_config (NMConfigCmdLineOptions *config_cli) config_data = nm_config_get_data (config); fprintf (stdout, "# NetworkManager configuration: %s\n", nm_config_data_get_config_description (config_data)); nm_config_data_log (config_data, "", "", nm_config_get_no_auto_default_file (config), stdout); + + warnings = nm_config_get_warnings (config); + if (warnings && warnings[0]) + fprintf (stdout, "\n"); + for ( ; warnings && warnings[0]; warnings++) + fprintf (stdout, "# WARNING: %s\n", warnings[0]); + return 0; } |