specifying multi value options

Bug #1039720 reported by Aaron Rosen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-neutronclient
Invalid
Undecided
Unassigned

Bug Description

arosen@awesome:/opt/stack/python-quantumclient$ quantum port-create --fixed_ip 10.0.0.111 --fixed_ip 10.0.0.112 c4864d8a-91e2-4c59-9b38-4d94c0385b6e
need more than 1 value to unpack

arosen@awesome:/opt/stack/python-quantumclient$ quantum -v port-create --fixed_ip 10.0.0.111 --fixed_ip 10.0.0.112 c4864d8a-91e2-4c59-9b38-4d94c0385b6e
DEBUG: quantumclient.quantum.v2_0.port.CreatePort get_data(Namespace(admin_state_down=True, columns=[], device_id=None, fixed_ip=['10.0.0.111', '10.0.0.112'], formatter='table', mac_address=None, name=None, network_id='c4864d8a-91e2-4c59-9b38-4d94c0385b6e', prefix='', request_format='json', tenant_id=None, value_specs=[], variables=[]))
DEBUG: quantumclient.client REQ: curl -i http://127.0.0.1:5000/v2.0/tokens -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-quantumclient"

DEBUG: quantumclient.client REQ BODY: {"auth": {"tenantName": "demo", "passwordCredentials": {"username": "demo", "password": "password"}}}

DEBUG: quantumclient.client RESP:{'date': 'Tue, 21 Aug 2012 20:08:00 GMT', 'transfer-encoding': 'chunked', 'status': '200', 'content-type': 'application/json', 'vary': 'X-Auth-Token'}

DEBUG: quantumclient.client RESP BODY:{"access": {"token": {"expires": "2012-08-22T20:08:00Z", "id": "6c91eb8ff4c84275861c513b0fe7c1d2", "tenant": {"enabled": true, "description": null, "name": "demo", "id": "eb3f6c689e9047608fb1b25a3c8b936d"}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://172.17.114.159:8774/v2/eb3f6c689e9047608fb1b25a3c8b936d", "region": "RegionOne", "publicURL": "http://172.17.114.159:8774/v2/eb3f6c689e9047608fb1b25a3c8b936d", "internalURL": "http://172.17.114.159:8774/v2/eb3f6c689e9047608fb1b25a3c8b936d"}], "endpoints_links": [], "type": "compute", "name": "Compute Service"}, {"endpoints": [{"adminURL": "http://172.17.114.159:9696/", "region": "RegionOne", "publicURL": "http://172.17.114.159:9696/", "internalURL": "http://172.17.114.159:9696/"}], "endpoints_links": [], "type": "network", "name": "Quantum Service"}, {"endpoints": [{"adminURL": "http://172.17.114.159:3333", "region": "RegionOne", "publicURL": "http://172.17.114.159:3333", "internalURL": "http://172.17.114.159:3333"}], "endpoints_links": [], "type": "s3", "name": "S3 Service"}, {"endpoints": [{"adminURL": "http://172.17.114.159:9292", "region": "RegionOne", "publicURL": "http://172.17.114.159:9292", "internalURL": "http://172.17.114.159:9292"}], "endpoints_links": [], "type": "image", "name": "Image Service"}, {"endpoints": [{"adminURL": "http://172.17.114.159:8776/v1/eb3f6c689e9047608fb1b25a3c8b936d", "region": "RegionOne", "publicURL": "http://172.17.114.159:8776/v1/eb3f6c689e9047608fb1b25a3c8b936d", "internalURL": "http://172.17.114.159:8776/v1/eb3f6c689e9047608fb1b25a3c8b936d"}], "endpoints_links": [], "type": "volume", "name": "Volume Service"}, {"endpoints": [{"adminURL": "http://172.17.114.159:8773/services/Admin", "region": "RegionOne", "publicURL": "http://172.17.114.159:8773/services/Cloud", "internalURL": "http://172.17.114.159:8773/services/Cloud"}], "endpoints_links": [], "type": "ec2", "name": "EC2 Service"}, {"endpoints": [{"adminURL": "http://172.17.114.159:35357/v2.0", "region": "RegionOne", "publicURL": "http://172.17.114.159:5000/v2.0", "internalURL": "http://172.17.114.159:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "Identity Service"}], "user": {"username": "demo", "roles_links": [], "id": "12ce227e181846f7bea097b323d91c53", "roles": [{"name": "Member"}, {"name": "anotherrole"}], "name": "demo"}, "metadata": {"is_admin": 0, "roles": ["0e49d26f9f324b51a999c8e39826f2b0", "9376caf4f51341cc806d659a7e4da0be"]}}}

DEBUG: quantumclient.client REQ: curl -i http://172.17.114.159:9696/v2.0/networks.json?fields=id&id=c4864d8a-91e2-4c59-9b38-4d94c0385b6e -X GET -H "User-Agent: python-quantumclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: 6c91eb8ff4c84275861c513b0fe7c1d2"

DEBUG: quantumclient.client RESP:{'date': 'Tue, 21 Aug 2012 20:08:00 GMT', 'status': '200', 'content-length': '62', 'content-type': 'application/json; charset=UTF-8', 'content-location': u'http://172.17.114.159:9696/v2.0/networks.json?fields=id&id=c4864d8a-91e2-4c59-9b38-4d94c0385b6e'}

DEBUG: quantumclient.client RESP BODY:{"networks": [{"id": "c4864d8a-91e2-4c59-9b38-4d94c0385b6e"}]}

ERROR: cliff.app need more than 1 value to unpack
DEBUG: quantumclient.shell clean_up CreatePort
DEBUG: quantumclient.shell got an error: need more than 1 value to unpack

Revision history for this message
Aaron Rosen (arosen) wrote :

This is actually invalid for create-port. The correct syntax is actually:

port-create --fixed_ip subnet_id=5cd3a4fa-fe43-4fe1-90b2-7ef082c0cf13,ip_address=1.1.1.114 --fixed_ip subnet_id=5cd3a4fa-fe43-4fe1-90b2-7ef082c0cf13,ip_address=1.1.1.19 b17eb0d5-317f-48f4-941a-03e30cd4fa9a

I haven't yet figured out how to modify these values via port-update. Using the same syntax returns successful but doesn't actually update the fixed_ips (port-update 5ecceca4-f95a-4b1c-b190-024d91d93ada --fixed_ip subnet_id=1eb40c2b-2f62-4817-822c-ff1df7357668,ip_address=1.1.1.4) . It ends up passing in:

{u'port': {u'fixed_ip': u'subnet_id=1eb40c2b-2f62-4817-822c-ff1df7357668,ip_address=1.1.1.4'}}

Revision history for this message
Gary Kotton (garyk) wrote :

Here are a few things I have done in the past (not sure if it is what you ar looking for)
 quantumv2 update_port portid --fixed_ips list=true type=dict ip_address=ip1,subnet_id=id1 ip_address=ip2,subnet_id=id2
quantumv2 update_port portid --fixed_ips type=dict ip_address=ip1,subnet_id=id1 ip_address=ip2,subnet_id=id2
Thanks
Gary

Revision history for this message
dan wendlandt (danwent) wrote : Re: [Bug 1039720] Re: specifying multi value options
Download full text (5.9 KiB)

getting this type of syntax documented as part of our Admin docs will
be critical. There are a lot of fairly common operations that require
non-trivial commands (e.g., show all ports on a network, or show all
ports for VM X).

On Thu, Aug 23, 2012 at 11:09 AM, Gary Kotton
<email address hidden> wrote:
> Here are a few things I have done in the past (not sure if it is what you ar looking for)
> quantumv2 update_port portid --fixed_ips list=true type=dict ip_address=ip1,subnet_id=id1 ip_address=ip2,subnet_id=id2
> quantumv2 update_port portid --fixed_ips type=dict ip_address=ip1,subnet_id=id1 ip_address=ip2,subnet_id=id2
> Thanks
> Gary
>
> --
> You received this bug notification because you are a member of Quantum
> Bugs, which is subscribed to python-quantumclient.
> https://bugs.launchpad.net/bugs/1039720
>
> Title:
> specifying multi value options
>
> Status in Python client library for Quantum:
> New
>
> Bug description:
> arosen@awesome:/opt/stack/python-quantumclient$ quantum port-create --fixed_ip 10.0.0.111 --fixed_ip 10.0.0.112 c4864d8a-91e2-4c59-9b38-4d94c0385b6e
> need more than 1 value to unpack
>
> arosen@awesome:/opt/stack/python-quantumclient$ quantum -v port-create --fixed_ip 10.0.0.111 --fixed_ip 10.0.0.112 c4864d8a-91e2-4c59-9b38-4d94c0385b6e
> DEBUG: quantumclient.quantum.v2_0.port.CreatePort get_data(Namespace(admin_state_down=True, columns=[], device_id=None, fixed_ip=['10.0.0.111', '10.0.0.112'], formatter='table', mac_address=None, name=None, network_id='c4864d8a-91e2-4c59-9b38-4d94c0385b6e', prefix='', request_format='json', tenant_id=None, value_specs=[], variables=[]))
> DEBUG: quantumclient.client REQ: curl -i http://127.0.0.1:5000/v2.0/tokens -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-quantumclient"
>
> DEBUG: quantumclient.client REQ BODY: {"auth": {"tenantName": "demo",
> "passwordCredentials": {"username": "demo", "password": "password"}}}
>
> DEBUG: quantumclient.client RESP:{'date': 'Tue, 21 Aug 2012 20:08:00
> GMT', 'transfer-encoding': 'chunked', 'status': '200', 'content-type':
> 'application/json', 'vary': 'X-Auth-Token'}
>
> DEBUG: quantumclient.client RESP BODY:{"access": {"token": {"expires":
> "2012-08-22T20:08:00Z", "id": "6c91eb8ff4c84275861c513b0fe7c1d2",
> "tenant": {"enabled": true, "description": null, "name": "demo", "id":
> "eb3f6c689e9047608fb1b25a3c8b936d"}}, "serviceCatalog": [{"endpoints":
> [{"adminURL":
> "http://172.17.114.159:8774/v2/eb3f6c689e9047608fb1b25a3c8b936d",
> "region": "RegionOne", "publicURL":
> "http://172.17.114.159:8774/v2/eb3f6c689e9047608fb1b25a3c8b936d",
> "internalURL":
> "http://172.17.114.159:8774/v2/eb3f6c689e9047608fb1b25a3c8b936d"}],
> "endpoints_links": [], "type": "compute", "name": "Compute Service"},
> {"endpoints": [{"adminURL": "http://172.17.114.159:9696/", "region":
> "RegionOne", "publicURL": "http://172.17.114.159:9696/",
> "internalURL": "http://172.17.114.159:9696/"}], "endpoints_links": [],
> "type": "network", "name": "Quantum Service"}, {"endpoints":
> [{"adminURL": "http://172.17.114.159:3333", "region": "RegionOne",
> "publicUR...

Read more...

Revision history for this message
Aaron Rosen (arosen) wrote :

Marking invalid since quantumclient can actually do this. Thanks Gary and Dan. Hopefully we will get this documented shortly.

Changed in python-quantumclient:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.