Comment 13 for bug 1341096

Revision history for this message
Akihiro Motoki (amotoki) wrote :

Regarding using {...}, it turns out there is nothing to do in neutronclient side.

{xxx,yyy,zzz} seems to be expanded to "xxx" "yyy" "zzz" by a shell.

I created the following shell script to check how command line parameters are parsed.

$ cat aaaa.sh
#!/bin/bash

i=0
while [ -n "$1" ]; do
  echo $i: $1
  shift
  i=`expr $i + 1`
done

and then I got the following:

$ ./aaaa.sh port-update p1 -- --fixed-ips type=dict subnet_id=024b4d12-4461-4e22-9b0b-e8dbbe782561,ip_address=10.0.0.12
0: port-update
1: p1
2: --
3: --fixed-ips
4: type=dict
5: subnet_id=024b4d12-4461-4e22-9b0b-e8dbbe782561,ip_address=10.0.0.12

It means if we run:

  neutron port-update d91892d0-43cf-4929-ba58-92da2a723e62 \
  --fixed-ips type=dict {subnet_id=7f5ae8f6-3882-4e58-bea7-1d76c5fa1bc1,ip_address=200.1.1.5}

neutron CLI receives

  neutron port-update d91892d0-43cf-4929-ba58-92da2a723e62 \
  --fixed-ips type=dict \
    subnet_id=7f5ae8f6-3882-4e58-bea7-1d76c5fa1bc1 \
    ip_address=200.1.1.5

In the current extra args parsing logic, it will be interpreted as a list with two elements: the one is subnet_id, the other is ip_address.