cli: fix setting 'slave-type' for `nmcli connection add type *-slave`
authorThomas Haller <thaller@redhat.com>
Wed, 30 Mar 2016 16:33:14 +0000 (18:33 +0200)
committerThomas Haller <thaller@redhat.com>
Wed, 30 Mar 2016 16:36:07 +0000 (18:36 +0200)
  $ nmcli connection add type bond-slave ifname eth1 con-name bond0.0 master nm-bond
  Error: Failed to add 'bond0.0' connection: connection.slave-type: Cannot set 'master' without 'slave-type'

Fixes: 8ad218e71c3a82d491af6daa516464dd020608f2

clients/cli/connections.c

index 0158dc2..3fca37f 100644 (file)
@@ -4783,6 +4783,9 @@ complete_slave (NMSettingConnection *s_con,
                                             _("Error: redundant 'master' option."));
                        return FALSE;
                }
+               g_object_set (s_con,
+                             NM_SETTING_CONNECTION_SLAVE_TYPE, slave_type,
+                             NULL);
                return TRUE;
        }