[integration tests] Exception "BadRequest: Security Group <uuid> in use." during deleting security group

Bug #1584774 reported by Georgy Dyuldin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Fix Released
High
Georgy Dyuldin

Bug Description

Test result:

https://mirantis.testrail.com/index.php?/tests/view/6074907

Trace:

self = <mos_tests.nova.nova_test.NovaIntegrationTests testMethod=test_nova_launch_v_m_from_image_with_all_flavours[(543358)]>

    def tearDown(self):
        for inst in self.instances:
            common_functions.delete_instance(self.nova, inst)
        self.instances = []
        for fip in self.floating_ips:
            common_functions.delete_floating_ip(self.nova, fip)
        self.floating_ips = []
        for volume in self.volumes:
            common_functions.delete_volume(self.cinder, volume)
        self.volumes = []
        for flavor in self.flavors:
            common_functions.delete_flavor(self.nova, flavor.id)
        self.flavors = []
        for key in self.keys:
            common_functions.delete_keys(self.nova, key.name)
        self.keys = []
> self.nova.security_groups.delete(self.sec_group)

mos_tests/nova/nova_test.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nova/local/lib/python2.7/site-packages/novaclient/v2/security_groups.py:81: in delete
    return self._delete('/os-security-groups/%s' % base.getid(group))
.tox/nova/local/lib/python2.7/site-packages/novaclient/base.py:342: in _delete
    resp, body = self.api.client.delete(url)
.tox/nova/local/lib/python2.7/site-packages/keystoneauth1/adapter.py:188: in delete
    return self.request(url, 'DELETE', **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <novaclient.client.SessionClient object at 0x7fc9fc139710>
url = '/os-security-groups/2c4e197b-7d11-432b-9865-4fbd46a26fcc'
method = 'DELETE'
kwargs = {'headers': {'Accept': 'application/json', 'User-Agent': 'python-novaclient', 'X-Auth-Token': 'gAAAAABXPZnjOvrHBM1rlcZ...KvBqCeqlcihmUQYc9B3mbjTGC2PjcJMX_3FIe2_CXMFC_9gWYpMbBKc2PDYonUm8jAkaKJZzQrVz7RtoXvn37LL4lRm8fxIU3WnDH26rb__4ayf6Zj-U'}}
raise_exc = True, resp = <Response [400]>
body = {'badRequest': {'code': 400, 'message': "Security Group 2c4e197b-7d11-432b-9865-4fbd46a26fcc in use.
Neutron server returns request_ids: ['req-43379652-6ac0-4387-830a-c298ec2e3276']"}}

    def request(self, url, method, **kwargs):
        kwargs.setdefault('headers', kwargs.get('headers', {}))
        api_versions.update_headers(kwargs["headers"], self.api_version)
        # NOTE(jamielennox): The standard call raises errors from
        # keystoneauth1, where we need to raise the novaclient errors.
        raise_exc = kwargs.pop('raise_exc', True)
        with utils.record_time(self.times, self.timings, method, url):
            resp, body = super(SessionClient, self).request(url,
                                                            method,
                                                            raise_exc=False,
                                                            **kwargs)
        # TODO(andreykurilin): uncomment this line, when we will be able to
        # check only nova-related calls
        # api_versions.check_headers(resp, self.api_version)
        if raise_exc and resp.status_code >= 400:
> raise exceptions.from_response(resp, body, url, method)
E BadRequest: Security Group 2c4e197b-7d11-432b-9865-4fbd46a26fcc in use.
E Neutron server returns request_ids: ['req-43379652-6ac0-4387-830a-c298ec2e3276'] (HTTP 400) (Request-ID: req-7e511fbd-4e43-4ec3-b7aa-53621c163822)

.tox/nova/local/lib/python2.7/site-packages/novaclient/client.py:100: BadRequest

Tags: area-qa
Changed in mos:
milestone: 10.0 → 9.0
Revision history for this message
Anna Babich (ababich) wrote :
Changed in mos:
assignee: MOS QA Team (mos-qa) → Georgy Dyuldin (g-dyuldin)
Revision history for this message
Georgy Dyuldin (g-dyuldin) wrote :

This commit should fix it:

https://review.gerrithub.io/#/c/278112/

Changed in mos:
status: Confirmed → Fix Released
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.