test_security_group.SecurityGroupTest.test_security_group_nova_exception fail with latest novaclient

Bug #1322098 reported by Ethan Lynn
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Undecided
Ethan Lynn
Icehouse
Fix Released
Undecided
Jason Dunsmore

Bug Description

here is log:

FAIL: heat.tests.test_security_group.SecurityGroupTest.test_security_group_nova_exception
tags: worker-6
----------------------------------------------------------------------
Empty attachments:
  pythonlogging:'ceilometerclient'
  pythonlogging:'cliff'
  pythonlogging:'heat-provision'
  pythonlogging:'iso8601'
  pythonlogging:'keyring'
  pythonlogging:'keystoneclient'
  pythonlogging:'migrate'
  pythonlogging:'neutronclient'
  pythonlogging:'novaclient'
  pythonlogging:'oauthlib'
  pythonlogging:'oslo'
  pythonlogging:'requests'
  pythonlogging:'routes'
  pythonlogging:'sqlalchemy'
  pythonlogging:'stevedore'
  pythonlogging:'swiftclient'
  pythonlogging:'troveclient'

pythonlogging:'': {{{
Task stack_task from Stack "test_stack" [52ff13f8-7b71-4cbc-ac84-5ac5ec8d923f] starting
Task stack_task from Stack "test_stack" [52ff13f8-7b71-4cbc-ac84-5ac5ec8d923f] running
Stack CREATE IN_PROGRESS (test_stack): Stack CREATE started
Task resource_action starting
creating SecurityGroup "the_sg" Stack "test_stack" [52ff13f8-7b71-4cbc-ac84-5ac5ec8d923f]
Task resource_action running
CREATE : SecurityGroup "the_sg" [2] Stack "test_stack" [52ff13f8-7b71-4cbc-ac84-5ac5ec8d923f]
Traceback (most recent call last):
  File "/home/elynn/source/openstack/heat/heat/engine/resource.py", line 383, in _do_action
    handle())
  File "/home/elynn/source/openstack/heat/heat/engine/resources/security_group.py", line 96, in handle_create
    self._handle_create_nova()
  File "/home/elynn/source/openstack/heat/heat/engine/resources/security_group.py", line 208, in _handle_create_nova
    if ex.message.find('already exists') >= 0:
AttributeError: 'int' object has no attribute 'find'
Task resource_action cancelled
Stack CREATE FAILED (test_stack): Resource CREATE failed: AttributeError: 'int' object has no attribute 'find'
Task stack_task from Stack "test_stack" [52ff13f8-7b71-4cbc-ac84-5ac5ec8d923f] complete
Validating SecurityGroup "the_sg" [2] Stack "test_stack" [52ff13f8-7b71-4cbc-ac84-5ac5ec8d923f]
}}}

Traceback (most recent call last):
  File "/home/elynn/source/openstack/heat/heat/tests/test_security_group.py", line 450, in test_security_group_nova_exception
    self.assertResourceState(sg, utils.PhysName('test_stack', 'the_sg'))
  File "/home/elynn/source/openstack/heat/heat/tests/test_security_group.py", line 163, in assertResourceState
    self.assertEqual((rsrc.CREATE, rsrc.COMPLETE), rsrc.state)
  File "/usr/lib/python2.7/site-packages/testtools/testcase.py", line 321, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/usr/lib/python2.7/site-packages/testtools/testcase.py", line 406, in assertThat
    raise mismatch_error
MismatchError: ('CREATE', 'COMPLETE') != ('CREATE', 'FAILED')

Need to update test cases.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Changed in heat:
assignee: nobody → Ethan Lynn (xuanlangjian)
status: New → In Progress
Revision history for this message
Steven Hardy (shardy) wrote :

Hmm, I raised a duplicate before I saw this, and posted this:

https://review.openstack.org/#/c/94859/

I think your patch only addresses one of the two failures, so I'll comment on the review.

Also, it seems like this is a novaclient bug, since it's a backwards incompatible change. I'm not even sure if novaclient itself works correctly due to this change.

See https://bugs.launchpad.net/python-novaclient/+bug/1322183

Let's see what the nova folks have to say about that, then figure out the way forward. :)

Revision history for this message
Zane Bitter (zaneb) wrote :

This should be fixed in master by https://review.openstack.org/#/c/97977 but requires a backport to Icehouse.

Changed in heat:
status: In Progress → Fix Committed
milestone: none → juno-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/107107

Changed in heat:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/icehouse)

Reviewed: https://review.openstack.org/107107
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=bd4ed52b78dc20759b0780e2fcece409c423f1d4
Submitter: Jenkins
Branch: stable/icehouse

commit bd4ed52b78dc20759b0780e2fcece409c423f1d4
Author: Jason Dunsmore <email address hidden>
Date: Tue Jul 15 11:52:46 2014 -0500

    Move novaclient exceptions to heat.tests.v1_1.fakes

    Applying novaclient exceptions fix from commit:
    9850832da563c1113e121b99d38feb21af9daa8d

    "Raising nova exceptions has been moved to
    heat.tests.v1_1.fakes.fake_exception since it is actually impossible
    to directly create a nova exception object which works on both
    novaclient 2.17 and (yet to be released) 2.18.
    nova.exceptions.from_response is stable across novaclient releases
    so all test exceptions are now raised using from_response."

    Change-Id: I0c5e58ffdd3eb13b9a87df22f1c5e06cec972913
    Closes-Bug: #1322098

Thierry Carrez (ttx)
Changed in heat:
milestone: juno-2 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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