Skip to content

Instantly share code, notes, and snippets.

@marios
Last active June 20, 2017 16:05
Show Gist options
  • Save marios/30b6309edca9b7abada473ea1d550999 to your computer and use it in GitHub Desktop.
Save marios/30b6309edca9b7abada473ea1d550999 to your computer and use it in GitHub Desktop.
newdiff
[stack@undercloud instack_undercloud]$ diff undercloud.py ../instack_undercloud.ORIG/undercloud.py
1310,1364d1309
< def _wait_for_mistral_execution(timeout_at, mistral, execution, message=''):
< while time.time() < timeout_at:
< exe = mistral.executions.get(execution.id)
< if exe.state == "RUNNING":
< time.sleep(5)
< continue
< if exe.state == "SUCCESS":
< return
< else:
< raise RuntimeError("ERROR! %s. ", message)
< else:
< exe = mistral.executions.get(execution.id)
< LOG.error("Timed out waiting for execution %s to finish. State: %s",
< exe.id, exe.state)
< raise RuntimeError("TIME OUT! %s", message)
<
<
< def _get_session():
< user, password, project, auth_url = _get_auth_values()
< auth_kwargs = {
< 'auth_url': auth_url,
< 'username': user,
< 'password': password,
< 'project_name': project,
< 'project_domain_name': 'Default',
< 'user_domain_name': 'Default',
< }
< auth_plugin_class = auth.get_plugin_class('password')
< if 'v2.0' not in auth_url:
< auth_kwargs.update({
< 'project_domain_name': 'default',
< 'user_domain_name': 'default'})
< auth_plugin = auth_plugin_class(**auth_kwargs)
< return session.Session(auth=auth_plugin)
<
<
< def _run_validation_groups(groups=[], mistral_url='', timeout=360):
< LOG.info('Starting and waiting for validation groups %s ', groups)
< #ess = _get_session()
< user, password, project, auth_url = _get_auth_values()
< mistral = mistralclient.client(
< mistral_url=mistral_url,
< username=user,
< api_key=password,
< project_name=tenant,
< auth_url=auth_url)
< execution = mistral.executions.create(
< 'tripleo.validations.v1.run_groups',
< workflow_input={'group_names': groups}
< )
< fail_message = ("error running the validation groups %s " % groups)
< timeout_at = time.time() + timeout
< _wait_for_mistral_execution(timeout_at, mistral, execution, fail_message)
<
<
1377a1323
>
1379,1383c1325,1345
< fail_message = ("error creating the default Deployment Plan %s "
< "Check the create_default_deployment_plan execution "
< "in Mistral with openstack workflow execution list " %
< plan_name)
< _wait_for_mistral_execution(timeout_at, mistral, execution, fail_message)
---
>
> while time.time() < timeout_at:
> exe = mistral.executions.get(execution.id)
> if exe.state == "RUNNING":
> time.sleep(5)
> continue
> if exe.state == "SUCCESS":
> return
> else:
> raise RuntimeError(
> "Failed to create the default Deployment Plan. Please check "
> "the create_default_deployment_plan execution in Mistral with "
> "`openstack workflow execution list`.")
> else:
> exe = mistral.executions.get(execution.id)
> LOG.error("Timed out waiting for execution %s to finish. State: %s",
> exe.id, exe.state)
> raise RuntimeError(
> "Timed out creating the default Deployment Plan. Please check "
> "the create_default_deployment_plan execution in Mistral with "
> "`openstack workflow execution list`.")
1501,1505d1462
< # Run the validations
< if CONF.enable_validations:
< mistral_url = instack_env['UNDERCLOUD_ENDPOINT_MISTRAL_PUBLIC']
< _run_validation_groups(["pre-upgrade", "pre-update"],
< mistral_url)
[stack@undercloud instack_undercloud]$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment