openstack api create security group rule doesn't allow self-referential group

Bug #965674 reported by Vish Ishaya
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Vish Ishaya

Bug Description

nova --debug secgroup-add-group-rule other other
...
send: u'POST /v2/b9b27bb898084602bce552d327a13dcf/os-security-group-rules HTTP/1.1\r\nHost: 192.168.27.100:8774\r\nContent-Length: 133\r\nx-auth-project-id: demo\r\naccept-encoding: gzip, deflate\r\naccept: application/json\r\nx-auth-token: ca33a36363ad4f6eb04039f536be0b4b\r\nuser-agent: python-novaclient\r\ncontent-type: application/json\r\n\r\n{"security_group_rule": {"from_port": null, "ip_protocol": null, "to_port": null, "parent_group_id": 2, "cidr": null, "group_id": 2}}'
reply: 'HTTP/1.1 400 Bad Request\r\n'
header: Content-Length: 111
header: Content-Type: application/json; charset=UTF-8
header: X-Compute-Request-Id: req-761c3a90-41d9-4450-9791-aa5620103818
header: Date: Mon, 26 Mar 2012 20:13:10 GMT
DEBUG (shell:416) Invalid input received: Parent group id and group id cannot be same (HTTP 400)
Traceback (most recent call last):
  File "/opt/stack/python-novaclient/novaclient/shell.py", line 413, in main
    OpenStackComputeShell().main(sys.argv[1:])
  File "/opt/stack/python-novaclient/novaclient/shell.py", line 364, in main
    args.func(self.cs, args)
  File "/opt/stack/python-novaclient/novaclient/v1_1/shell.py", line 1270, in do_secgroup_add_group_rule
    rule = cs.security_group_rules.create(secgroup.id, **params)
  File "/opt/stack/python-novaclient/novaclient/v1_1/security_group_rules.py", line 55, in create
    'security_group_rule')
  File "/opt/stack/python-novaclient/novaclient/base.py", line 157, in _create
    resp, body = self.api.client.post(url, body=body)
  File "/opt/stack/python-novaclient/novaclient/client.py", line 139, in post
    return self._cs_request(url, 'POST', **kwargs)
  File "/opt/stack/python-novaclient/novaclient/client.py", line 124, in _cs_request
    **kwargs)
  File "/opt/stack/python-novaclient/novaclient/client.py", line 107, in request
    raise exceptions.from_response(resp, body)
BadRequest: Invalid input received: Parent group id and group id cannot be same (HTTP 400)
ERROR: Invalid input received: Parent group id and group id cannot be same (HTTP 400)

This is incorrect, self-referential groups should be allowed as they are in the ec2-api

Changed in nova:
status: New → In Progress
importance: Undecided → Low
tags: added: essex-rc-potential
Changed in nova:
assignee: nobody → Vish Ishaya (vishvananda)
milestone: none → essex-rc2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/5834

Thierry Carrez (ttx)
tags: removed: essex-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/5834
Committed: http://github.com/openstack/nova/commit/1892c2851d33eb2f5e6bb1faf0610c710888cd68
Submitter: Jenkins
Branch: master

commit 1892c2851d33eb2f5e6bb1faf0610c710888cd68
Author: Vishvananda Ishaya <email address hidden>
Date: Mon Mar 26 20:38:03 2012 +0000

    Allow self-referential groups to be created

     fixes bug 965674

    Change-Id: I41db135f6437e1f1cb496528ae4d134c0d9cb744

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (milestone-proposed)

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/6012

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (milestone-proposed)

Reviewed: https://review.openstack.org/6012
Committed: http://github.com/openstack/nova/commit/0098c870d17e464fd7f5cc7869530a3484b44b5e
Submitter: Jenkins
Branch: milestone-proposed

commit 0098c870d17e464fd7f5cc7869530a3484b44b5e
Author: Vishvananda Ishaya <email address hidden>
Date: Mon Mar 26 20:38:03 2012 +0000

    Allow self-referential groups to be created

     fixes bug 965674

    Change-Id: I41db135f6437e1f1cb496528ae4d134c0d9cb744

Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-rc2 → 2012.1
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.