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 771870 - [review] [nmcli] explicitly select filename/JSON type for team.config setting [th/nmcli-team-config-args-bgo771870]
[review] [nmcli] explicitly select filename/JSON type for team.config setting...
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: nmcli
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-09-23 10:04 UTC by Thomas Haller
Modified: 2016-09-27 09:05 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Thomas Haller 2016-09-23 10:04:53 UTC
When setting the team.config or team-port.config, nmcli allows either specifying a filename or the JSON inline.

Add a possibility to explicitly select whether it should be a file. This is mainly to make scripting more robust.

  nmcli connection modify my-team team.config "file://$FILE"
  nmcli connection modify my-team team.config "file://"<(cat "$FILE")

or

  nmcli connection modify my-team team.config "json://$(cat $FILE)"
  
  JSON="$(cat "$FILE")"
  nmcli connection modify my-team team.config "json://$JSON"



Please review
Comment 1 Beniamino Galvani 2016-09-27 08:19:42 UTC
> cli: support explicitly selecting team-config as file or json data

 /*
  * nmc_team_check_config:
  * @config: file name with team config, or raw team JSON config data
- * @out_config: raw team JSON config data (with removed new-line characters)
+ * @out_config: raw team JSON config data
+ *   The value must be returned with g_free().

s/returned/freed/ ?

Rest LGTM.