After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 750590 - [review] lr/cli-add-properties: make it possible to specify properties upon connection addition
[review] lr/cli-add-properties: make it possible to specify properties upon c...
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: 698076 nm-review 740749
 
 
Reported: 2015-06-08 19:32 UTC by Lubomir Rintel
Modified: 2015-07-02 07:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Lubomir Rintel 2015-06-08 19:32:43 UTC
The point is to atomically add a connection with (or without) desired properties, without a separate add and modify commands (since the addition of autoconnect=yes connection would trigger autoactivation).

83e825c cli: allow specifying arbitrary properties on "nmcli c add"
495aec5 cli: refactor: split connection property reader from do_connection_modify()
19d9db5 cli: trivial: move is_property_valid()
Comment 1 Thomas Haller 2015-06-08 20:13:36 UTC
does this solve bug 740749?
Comment 2 Beniamino Galvani 2015-06-09 12:03:53 UTC
LGTM and seems very useful.
Comment 3 Thomas Haller 2015-06-11 11:55:54 UTC
Please refer to the related bz in the commit message:

  https://bugzilla.gnome.org/show_bug.cgi?id=698076
  https://bugzilla.gnome.org/show_bug.cgi?id=740749

(and close them after merging this BZ).
Comment 4 Thomas Haller 2015-06-11 12:19:11 UTC
locks good.

Still needs bash-completion. Contrary to what we do for `nmcli connection modify` (which asks nmcli connection show for valid properties), just complete with a static list of options.
Comment 5 Dan Williams 2015-06-11 15:44:21 UTC
> cli: refactor: split connection property reader from do_connection_modify()

While you're there, it looks like 'property_name' gets leaked each time through the while() loop.  Maybe move the 'char *property_name' into the while loop and then use "gs_free char *property_name = NULL" to fix that up?  Could also benefit from further gsystem-local-alloc fixups for 'strv' and 'local'.

The rest LGTM.
Comment 6 Lubomir Rintel 2015-07-01 09:46:02 UTC
(In reply to Thomas Haller from comment #4)
> Still needs bash-completion. Contrary to what we do for `nmcli connection
> modify` (which asks nmcli connection show for valid properties), just
> complete with a static list of options.

Done. Abused the editor.

(In reply to Dan Williams from comment #5)
> > cli: refactor: split connection property reader from do_connection_modify()
> 
> While you're there, it looks like 'property_name' gets leaked each time
> through the while() loop.  Maybe move the 'char *property_name' into the
> while loop and then use "gs_free char *property_name = NULL" to fix that up?

Done.

c68a1ba cli: trivial: move is_property_valid()
b12c042 cli: refactor: split connection property reader from do_connection_modify()
3fb476d cli: allow specifying arbitrary properties on "nmcli c add"
ab39eda cli: add bash completion for 'nmcli c add -- <property list>'
Comment 7 Thomas Haller 2015-07-01 15:47:57 UTC
(In reply to Lubomir Rintel from comment #6)
> (In reply to Thomas Haller from comment #4)
> > Still needs bash-completion. Contrary to what we do for `nmcli connection
> > modify` (which asks nmcli connection show for valid properties), just
> > complete with a static list of options.
> 
> Done. Abused the editor.

Pushed a fixup! commit too.


> (In reply to Dan Williams from comment #5)
> > > cli: refactor: split connection property reader from do_connection_modify()
> > 
> > While you're there, it looks like 'property_name' gets leaked each time
> > through the while() loop.  Maybe move the 'char *property_name' into the
> > while loop and then use "gs_free char *property_name = NULL" to fix that up?
> 
> Done.
> 
> c68a1ba cli: trivial: move is_property_valid()
> b12c042 cli: refactor: split connection property reader from
> do_connection_modify()
> 3fb476d cli: allow specifying arbitrary properties on "nmcli c add"
> ab39eda cli: add bash completion for 'nmcli c add -- <property list>'



LGTM
Comment 8 Lubomir Rintel 2015-07-02 07:39:01 UTC
39ed60d merge,cli: branch 'lr/cli-add-properties'
81f1e3d cli: add bash completion for 'nmcli c add -- <property list>'
b3e57cf cli: allow specifying arbitrary properties on "nmcli c add"
15149d9 cli: refactor: split connection property reader from do_connection_modify()
df69bd1 cli: trivial: move is_property_valid()