Esempio n. 1
0
 def _update_central_plugins():
     if not update_plugins:
         return
     sequence = graph.sequence()
     add_plugins_to_uninstall(ctx, central_plugins_to_uninstall, sequence)
     add_plugins_to_install(ctx, central_plugins_to_install, sequence)
     graph.execute()
Esempio n. 2
0
    def test_add_plugin_to_uninstall_adds_to_sequence(self):
        plugins_list = ['something']
        utils.add_plugins_to_uninstall(
            self.ctx_mock, plugins_list, self.sequence_mock)

        self.ctx_mock.send_event.assert_called()
        self.ctx_mock.execute_task.assert_called_with(
            task_name='cloudify_agent.operations.uninstall_plugins',
            kwargs={
                'plugins': plugins_list,
                'delete_managed_plugins': False})
        self.sequence_mock.add.assert_called_with('send_event', 'execute_task')
def delete(ctx, deployment_plugins_to_uninstall, workflow_plugins_to_uninstall,
           delete_logs, **_):
    graph = ctx.graph_mode()
    sequence = graph.sequence()

    sequence.add(
        ctx.send_event('Deleting deployment [{}] environment'.format(
            ctx.deployment.id)))

    plugins_to_uninstall = extract_and_merge_plugins(
        deployment_plugins_to_uninstall,
        workflow_plugins_to_uninstall,
        with_repetition=True)
    add_plugins_to_uninstall(ctx, plugins_to_uninstall, sequence)

    graph.execute()
    _delete_deployment_workdir(ctx)
    if delete_logs:
        ctx.send_event("Deleting management workers' logs for deployment")
        _delete_logs(ctx)
    _send_request_to_delete_deployment_from_db(ctx)
Esempio n. 4
0
 def test_uinstall_task_not_executed(self):
     utils.add_plugins_to_uninstall(None, False, None)
Esempio n. 5
0
 def _update_plugins():
     sequence = graph.sequence()
     add_plugins_to_uninstall(ctx, plugins_to_uninstall, sequence)
     add_plugins_to_install(ctx, plugins_to_install, sequence)
     graph.execute()