Merge "Call validations upload workflow instead of action"
This commit is contained in:
commit
3fc4cc7049
|
@ -1354,7 +1354,8 @@ class TestPostConfig(BaseTestCase):
|
||||||
@mock.patch('instack_undercloud.undercloud._create_mistral_config_'
|
@mock.patch('instack_undercloud.undercloud._create_mistral_config_'
|
||||||
'environment')
|
'environment')
|
||||||
@mock.patch('instack_undercloud.undercloud._create_default_plan')
|
@mock.patch('instack_undercloud.undercloud._create_default_plan')
|
||||||
def test_post_config_mistral(self, mock_create, mock_cmce,
|
@mock.patch('instack_undercloud.undercloud._upload_validations_to_swift')
|
||||||
|
def test_post_config_mistral(self, mock_upload, mock_create, mock_cmce,
|
||||||
mock_listdir, mock_isfile):
|
mock_listdir, mock_isfile):
|
||||||
instack_env = {}
|
instack_env = {}
|
||||||
mock_mistral = mock.Mock()
|
mock_mistral = mock.Mock()
|
||||||
|
@ -1393,6 +1394,7 @@ class TestPostConfig(BaseTestCase):
|
||||||
mock_mistral.workbooks.create.mock_calls)
|
mock_mistral.workbooks.create.mock_calls)
|
||||||
mock_cmce.assert_called_once_with(instack_env, mock_mistral)
|
mock_cmce.assert_called_once_with(instack_env, mock_mistral)
|
||||||
mock_create.assert_called_once_with(mock_mistral, ['hut8'])
|
mock_create.assert_called_once_with(mock_mistral, ['hut8'])
|
||||||
|
mock_upload.assert_called_once_with(mock_mistral)
|
||||||
|
|
||||||
def _neutron_mocks(self):
|
def _neutron_mocks(self):
|
||||||
mock_sdk = mock.MagicMock()
|
mock_sdk = mock.MagicMock()
|
||||||
|
|
|
@ -1881,9 +1881,14 @@ def _create_default_plan(mistral, plans, timeout=360):
|
||||||
fail_on_error=True)
|
fail_on_error=True)
|
||||||
|
|
||||||
|
|
||||||
def _upload_validations_to_swift(mistral):
|
def _upload_validations_to_swift(mistral, timeout=60):
|
||||||
LOG.info('Uploading default validations to Swift')
|
LOG.info('Uploading default validations to Swift')
|
||||||
mistral.action_executions.create('tripleo.validations.upload')
|
execution = mistral.executions.create(
|
||||||
|
'tripleo.validations.v1.upload_validations')
|
||||||
|
fail_message = "error uploading default validations to Swift"
|
||||||
|
timeout_at = time.time() + timeout
|
||||||
|
_wait_for_mistral_execution(timeout_at, mistral, execution, fail_message,
|
||||||
|
fail_on_error=True)
|
||||||
|
|
||||||
|
|
||||||
def _prepare_ssh_environment(mistral):
|
def _prepare_ssh_environment(mistral):
|
||||||
|
|
Loading…
Reference in New Issue