def _get_tasks_graph(dep_ctx, blueprint, deployment): """Create a deployment creation tasks graph """ blueprint_plan = blueprint['plan'] return generate_create_dep_tasks_graph( dep_ctx, deployment_plugins_to_install=blueprint_plan[ 'deployment_plugins_to_install'], workflow_plugins_to_install=blueprint_plan[ 'workflow_plugins_to_install'], policy_configuration={ 'policy_types': deployment['policy_types'], 'policy_triggers': deployment['policy_triggers'], 'groups': deployment['groups'] })
def _get_tasks_graph(self, dep_ctx, blueprint, deployment, token): """Create a deployment creation tasks graph """ blueprint_plan = blueprint['plan'] return generate_create_dep_tasks_graph( dep_ctx, deployment_plugins_to_install=blueprint_plan[ 'deployment_plugins_to_install'], workflow_plugins_to_install=blueprint_plan[ 'workflow_plugins_to_install'], policy_configuration={ 'api_token': token, 'policy_types': deployment['policy_types'], 'policy_triggers': deployment['policy_triggers'], 'groups': deployment['groups'] } )
def recreate_deployments_environments(deployments_to_skip): rest_client = get_rest_client() for dep_id, dep_ctx in ctx.deployments_contexts.iteritems(): if dep_id in deployments_to_skip: continue with dep_ctx: dep = rest_client.deployments.get(dep_id) blueprint = rest_client.blueprints.get(dep_ctx.blueprint.id) blueprint_plan = blueprint['plan'] tasks_graph = generate_create_dep_tasks_graph( dep_ctx, deployment_plugins_to_install=blueprint_plan[ 'deployment_plugins_to_install'], workflow_plugins_to_install=blueprint_plan[ 'workflow_plugins_to_install'], policy_configuration={ 'policy_types': dep['policy_types'], 'policy_triggers': dep['policy_triggers'], 'groups': dep['groups'] }) tasks_graph.execute() ctx.send_event('Successfully created deployment environment ' 'for deployment {0}'.format(dep_id))
def recreate_deployments_environments(deployments_to_skip): rest_client = get_rest_client() for dep_id, dep_ctx in ctx.deployments_contexts.iteritems(): if dep_id in deployments_to_skip: continue with dep_ctx: dep = rest_client.deployments.get(dep_id) blueprint = rest_client.blueprints.get(dep_ctx.blueprint.id) blueprint_plan = blueprint['plan'] tasks_graph = generate_create_dep_tasks_graph( dep_ctx, deployment_plugins_to_install=blueprint_plan[ 'deployment_plugins_to_install'], workflow_plugins_to_install=blueprint_plan[ 'workflow_plugins_to_install'], policy_configuration={ 'policy_types': dep['policy_types'], 'policy_triggers': dep['policy_triggers'], 'groups': dep['groups'] } ) tasks_graph.execute() ctx.send_event('Successfully created deployment environment ' 'for deployment {0}'.format(dep_id))