summaryrefslogtreecommitdiff
path: root/libnm-util/nm-setting-ip6-config.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-util/nm-setting-ip6-config.c')
-rw-r--r--libnm-util/nm-setting-ip6-config.c54
1 files changed, 33 insertions, 21 deletions
diff --git a/libnm-util/nm-setting-ip6-config.c b/libnm-util/nm-setting-ip6-config.c
index 8185713445..11eb15cec6 100644
--- a/libnm-util/nm-setting-ip6-config.c
+++ b/libnm-util/nm-setting-ip6-config.c
@@ -19,12 +19,13 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
- * (C) Copyright 2007 - 2012 Red Hat, Inc.
+ * (C) Copyright 2007 - 2013 Red Hat, Inc.
*/
#include <string.h>
-
#include <dbus/dbus-glib.h>
+#include <glib/gi18n.h>
+
#include "nm-setting-ip6-config.h"
#include "nm-param-spec-specialized.h"
#include "nm-utils.h"
@@ -668,19 +669,21 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
if (!priv->method) {
- g_set_error (error,
- NM_SETTING_IP6_CONFIG_ERROR,
- NM_SETTING_IP6_CONFIG_ERROR_MISSING_PROPERTY,
- NM_SETTING_IP6_CONFIG_METHOD);
+ g_set_error_literal (error,
+ NM_SETTING_IP6_CONFIG_ERROR,
+ NM_SETTING_IP6_CONFIG_ERROR_MISSING_PROPERTY,
+ _("property is missing"));
+ g_prefix_error (error, "%s: ", NM_SETTING_IP6_CONFIG_METHOD);
return FALSE;
}
if (!strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) {
if (!priv->addresses) {
- g_set_error (error,
- NM_SETTING_IP6_CONFIG_ERROR,
- NM_SETTING_IP6_CONFIG_ERROR_MISSING_PROPERTY,
- NM_SETTING_IP6_CONFIG_ADDRESSES);
+ g_set_error_literal (error,
+ NM_SETTING_IP6_CONFIG_ERROR,
+ NM_SETTING_IP6_CONFIG_ERROR_MISSING_PROPERTY,
+ _("property is missing"));
+ g_prefix_error (error, "%s: ", NM_SETTING_IP6_CONFIG_ADDRESSES);
return FALSE;
}
} else if ( !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)
@@ -690,7 +693,10 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
g_set_error (error,
NM_SETTING_IP6_CONFIG_ERROR,
NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD,
- NM_SETTING_IP6_CONFIG_DNS);
+ _("'%s' not allowed for %s=%s"),
+ _("this property is not allowed for '%s=%s'"),
+ NM_SETTING_IP6_CONFIG_METHOD, priv->method);
+ g_prefix_error (error, "%s: ", NM_SETTING_IP6_CONFIG_DNS);
return FALSE;
}
@@ -698,7 +704,9 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
g_set_error (error,
NM_SETTING_IP6_CONFIG_ERROR,
NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD,
- NM_SETTING_IP6_CONFIG_DNS_SEARCH);
+ _("this property is not allowed for '%s=%s'"),
+ NM_SETTING_IP6_CONFIG_METHOD, priv->method);
+ g_prefix_error (error, "%s: ", NM_SETTING_IP6_CONFIG_DNS_SEARCH);
return FALSE;
}
@@ -706,25 +714,29 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
g_set_error (error,
NM_SETTING_IP6_CONFIG_ERROR,
NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD,
- NM_SETTING_IP6_CONFIG_ADDRESSES);
+ _("this property is not allowed for '%s=%s'"),
+ NM_SETTING_IP4_CONFIG_METHOD, priv->method);
+ g_prefix_error (error, "%s: ", NM_SETTING_IP6_CONFIG_ADDRESSES);
return FALSE;
}
} else if ( !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_AUTO)
|| !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) {
/* nothing to do */
} else {
- g_set_error (error,
- NM_SETTING_IP6_CONFIG_ERROR,
- NM_SETTING_IP6_CONFIG_ERROR_INVALID_PROPERTY,
- NM_SETTING_IP6_CONFIG_METHOD);
+ g_set_error_literal (error,
+ NM_SETTING_IP6_CONFIG_ERROR,
+ NM_SETTING_IP6_CONFIG_ERROR_INVALID_PROPERTY,
+ _("property is invalid"));
+ g_prefix_error (error, "%s: ", NM_SETTING_IP6_CONFIG_METHOD);
return FALSE;
}
if (priv->dhcp_hostname && !strlen (priv->dhcp_hostname)) {
- g_set_error (error,
- NM_SETTING_IP6_CONFIG_ERROR,
- NM_SETTING_IP6_CONFIG_ERROR_INVALID_PROPERTY,
- NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME);
+ g_set_error_literal (error,
+ NM_SETTING_IP6_CONFIG_ERROR,
+ NM_SETTING_IP6_CONFIG_ERROR_INVALID_PROPERTY,
+ _("property is missing"));
+ g_prefix_error (error, "%s: ", NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME);
return FALSE;
}