Bay status returns None initially after create
When creating a bay using heat resources, OS::Magnum::Bay, the first bay status returns None, then the following bay status returns the correct CREATE_IN_PROGRESS. Change-Id: I6e3802b1321de5d300e167c5b0f1a9ebf291fe13 Closes-Bug: #1507598
This commit is contained in:
parent
ba0bcf20e3
commit
5de12d9ea8
|
@ -153,6 +153,7 @@ class Handler(object):
|
|||
raise
|
||||
|
||||
bay.stack_id = created_stack['stack']['id']
|
||||
bay.status = bay_status.CREATE_IN_PROGRESS
|
||||
bay.create()
|
||||
|
||||
self._poll_and_check(osc, bay)
|
||||
|
|
|
@ -17,6 +17,7 @@ from tempest_lib.common.utils import data_utils
|
|||
from tempest_lib import exceptions
|
||||
import testtools
|
||||
|
||||
from magnum.objects.fields import BayStatus
|
||||
from magnum.tests.functional.common import base
|
||||
from magnum.tests.functional.common import datagen
|
||||
|
||||
|
@ -94,7 +95,7 @@ class BayTest(base.BaseMagnumTest):
|
|||
self.assertEqual(resp.status, 201)
|
||||
self.assertIsNotNone(model.uuid)
|
||||
self.bays.append(model.uuid)
|
||||
self.assertIsNone(model.status)
|
||||
self.assertEqual(BayStatus.CREATE_IN_PROGRESS, model.status)
|
||||
self.assertIsNone(model.status_reason)
|
||||
self.assertEqual(model.baymodel_id, self.baymodel.uuid)
|
||||
self.bay_uuid = model.uuid
|
||||
|
|
|
@ -194,14 +194,15 @@ class TestHandler(db_base.DbTestCase):
|
|||
# will get notice that baymodel_id is updated and will update it
|
||||
# in db.
|
||||
self.bay.baymodel_id = self.baymodel.uuid
|
||||
self.handler.bay_create(self.context,
|
||||
self.bay, timeout)
|
||||
bay = self.handler.bay_create(self.context,
|
||||
self.bay, timeout)
|
||||
|
||||
mock_create_stack.assert_called_once_with(self.context,
|
||||
mock.sentinel.osc,
|
||||
self.bay, timeout)
|
||||
mock_cert_manager.generate_certificates_to_bay.assert_called_once_with(
|
||||
self.bay)
|
||||
self.assertEqual(bay_status.CREATE_IN_PROGRESS, bay.status)
|
||||
|
||||
@patch('magnum.conductor.handlers.bay_conductor.cert_manager')
|
||||
@patch('magnum.conductor.handlers.bay_conductor._create_stack')
|
||||
|
|
Loading…
Reference in New Issue