Call validations upload workflow instead of action

Change-Id: Ifcf813b51053c8e1ab57c1cc031a4c980f198c69
Partial-Bug: #1774185
Depends-On: I55be508ce5906c2f12068ae1713657eab2f658fd
This commit is contained in:
Ana Krivokapic 2018-06-18 15:41:01 +02:00
parent 41c401ca65
commit a7b7f345a9
2 changed files with 10 additions and 3 deletions

View File

@ -1354,7 +1354,8 @@ class TestPostConfig(BaseTestCase):
@mock.patch('instack_undercloud.undercloud._create_mistral_config_'
'environment')
@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):
instack_env = {}
mock_mistral = mock.Mock()
@ -1393,6 +1394,7 @@ class TestPostConfig(BaseTestCase):
mock_mistral.workbooks.create.mock_calls)
mock_cmce.assert_called_once_with(instack_env, mock_mistral)
mock_create.assert_called_once_with(mock_mistral, ['hut8'])
mock_upload.assert_called_once_with(mock_mistral)
def _neutron_mocks(self):
mock_sdk = mock.MagicMock()

View File

@ -1894,9 +1894,14 @@ def _create_default_plan(mistral, plans, timeout=360):
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')
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):