diff options
Diffstat (limited to 'cli/src/utils.c')
-rw-r--r-- | cli/src/utils.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/cli/src/utils.c b/cli/src/utils.c index 3c4e4f369..bcc51bbd8 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -17,9 +17,6 @@ * (C) Copyright 2010 - 2011 Red Hat, Inc. */ -/* Generated configuration file */ -#include "config.h" - #include <stdio.h> #include <string.h> @@ -354,49 +351,3 @@ done: return has_owner; } -/* -* Compare versions of nmcli and NM daemon. -* Return: TRUE - the versions match (when only major and minor match, print a warning) -* FALSE - versions mismatch -*/ -gboolean -nmc_versions_match (NmCli *nmc) -{ - const char *nm_ver = NULL; - const char *dot; - gboolean match = FALSE; - - g_return_val_if_fail (nmc != NULL, FALSE); - - /* --nocheck option - don't compare the versions */ - if (nmc->nocheck_ver) - return TRUE; - - nmc->get_client (nmc); - nm_ver = nm_client_get_version (nmc->client); - if (nm_ver) { - if (!strcmp (nm_ver, VERSION)) - match = TRUE; - else { - dot = strchr (nm_ver, '.'); - if (dot) { - dot = strchr (dot + 1, '.'); - if (dot && !strncmp (nm_ver, VERSION, dot-nm_ver)) { - fprintf(stderr, - _("Warning: nmcli (%s) and NetworkManager (%s) versions don't match. Use --nocheck to suppress the warning.\n"), - VERSION, nm_ver); - match = TRUE; - } - } - } - } - - if (!match) { - g_string_printf (nmc->return_text, _("Error: nmcli (%s) and NetworkManager (%s) versions don't match. Force execution using --nocheck, but the results are unpredictable."), - VERSION, nm_ver ? nm_ver : _("unknown")); - nmc->return_value = NMC_RESULT_ERROR_VERSIONS_MISMATCH; - } - - return match; -} - |