cli: allow resetting the connection.master to NULL

Without this patch, the following two commands fail:
  nmcli connection modify em1 connection.master
  nmcli connection modify em1 connection.master ""

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2014-02-24 09:33:48 +01:00
parent 93e4e0f8a1
commit 8a67713e9e

View file

@ -2372,8 +2372,12 @@ nmc_property_con_set_master (NMSetting *setting, const char *prop, const char *v
{
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
if ( !nm_utils_iface_valid_name (val)
&& !nm_utils_is_uuid (val)) {
if (!val)
;
else if (!*val)
val = NULL;
else if ( !nm_utils_iface_valid_name (val)
&& !nm_utils_is_uuid (val)) {
g_set_error (error, 1, 0,
_("'%s' is not valid master; use ifname or connection UUID"),
val);