mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-06 07:58:00 +02:00
config: print config warnings during NetworkManager --print-config
(cherry picked from commit fd8c8ffe0d)
This commit is contained in:
parent
74d0571cb4
commit
096da3a046
1 changed files with 8 additions and 0 deletions
|
|
@ -154,6 +154,7 @@ print_config (NMConfigCmdLineOptions *config_cli)
|
||||||
gs_unref_object NMConfig *config = NULL;
|
gs_unref_object NMConfig *config = NULL;
|
||||||
gs_free_error GError *error = NULL;
|
gs_free_error GError *error = NULL;
|
||||||
NMConfigData *config_data;
|
NMConfigData *config_data;
|
||||||
|
const char *const*warnings;
|
||||||
|
|
||||||
nm_logging_setup ("OFF", "ALL", NULL, NULL);
|
nm_logging_setup ("OFF", "ALL", NULL, NULL);
|
||||||
|
|
||||||
|
|
@ -166,6 +167,13 @@ print_config (NMConfigCmdLineOptions *config_cli)
|
||||||
config_data = nm_config_get_data (config);
|
config_data = nm_config_get_data (config);
|
||||||
fprintf (stdout, "# NetworkManager configuration: %s\n", nm_config_data_get_config_description (config_data));
|
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);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue