[openstack-dev] [openstackclient] Use and practices of --format shell for defining individual variables

Terry Howe terrylhowe at gmail.com
Tue May 26 19:59:41 UTC 2015


>
>
> I came across the following neutron client specific syntax and decided to
> see if I could reproduce using the openstack client and it's flexible
> formatting capabilities
>
>
> $ NIC_ID1=$(neutron net-show public | awk '/ id /{print $4}')
>
> $  echo $NIC_ID1
> 210d976e-16a3-42dc-ac31-f01810dbd297
> ...


The show commands for neutron client and OSC  have a format 'value' option
that may help:

$ os network show -c id -f value netty
00d7e1af-8749-411f-96da-3bda20601cb3
$ NETTY_ID=$(os network show -c id -f value netty)
$ echo $NETTY_ID
00d7e1af-8749-411f-96da-3bda20601cb3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150526/146f8186/attachment.html>


More information about the OpenStack-dev mailing list