Пример #1
0
def _invoke_serializer(serializer, cluster, nodes, ignore_customized):
    fire_callback_on_before_deployment_serialization(cluster, cluster.nodes,
                                                     ignore_customized)

    objects.Cluster.set_primary_roles(cluster, nodes)
    data = serializer.serialize(cluster,
                                nodes,
                                ignore_customized=ignore_customized)
    return _execute_pipeline(data, cluster, nodes, ignore_customized)
Пример #2
0
def _invoke_serializer(serializer, cluster, nodes, ignore_customized):
    extensions.fire_callback_on_before_deployment_serialization(
        cluster, cluster.nodes, ignore_customized
    )

    objects.Cluster.set_primary_roles(cluster, nodes)
    return serializer.serialize(
        cluster, nodes, ignore_customized=ignore_customized
    )
def _invoke_serializer(serializer, cluster, nodes, ignore_customized):
    extensions.fire_callback_on_before_deployment_serialization(
        cluster, cluster.nodes, ignore_customized
    )

    objects.Cluster.set_primary_roles(cluster, nodes)
    return serializer.serialize(
        cluster, nodes, ignore_customized=ignore_customized
    )
Пример #4
0
def _invoke_serializer(serializer, cluster, nodes, ignore_customized):
    fire_callback_on_before_deployment_serialization(
        cluster, cluster.nodes, ignore_customized
    )

    objects.Cluster.set_primary_roles(cluster, nodes)
    data = serializer.serialize(
        cluster, nodes, ignore_customized=ignore_customized
    )
    return _execute_pipeline(data, cluster, nodes, ignore_customized)
Пример #5
0
    def test_fire_callback_on_before_deployment_serialization(self, get_m):
        cluster = mock.MagicMock()
        cluster.extensions = ['ex1']
        fire_callback_on_before_deployment_serialization(
            cluster, mock.sentinel.nodes, mock.sentinel.ignore_customized)

        ex1 = get_m.return_value[0]
        self.assertEqual('ex1', ex1.name)
        ex1.on_before_deployment_serialization.assert_called_once_with(
            cluster, mock.sentinel.nodes, mock.sentinel.ignore_customized)
        ex2 = get_m.return_value[1]
        self.assertEqual('ex2', ex2.name)
        self.assertFalse(ex2.on_before_deployment_serialization.called)
Пример #6
0
    def test_fire_callback_on_before_deployment_serialization(self, get_m):
        cluster = mock.MagicMock()
        cluster.extensions = ['ex1']
        fire_callback_on_before_deployment_serialization(
            cluster, mock.sentinel.nodes, mock.sentinel.ignore_customized)

        ex1 = get_m.return_value[0]
        self.assertEqual('ex1', ex1.name)
        ex1.on_before_deployment_serialization.assert_called_once_with(
            cluster, mock.sentinel.nodes, mock.sentinel.ignore_customized)
        ex2 = get_m.return_value[1]
        self.assertEqual('ex2', ex2.name)
        self.assertFalse(ex2.on_before_deployment_serialization.called)
def _invoke_serializer(serializer, cluster, nodes,
                       ignore_customized, skip_extensions):
    if not skip_extensions:
        extensions.fire_callback_on_before_deployment_serialization(
            cluster, cluster.nodes, ignore_customized
        )

    objects.Cluster.set_primary_tags(cluster, nodes)
    # commit the transaction immediately so that the updates
    # made to nodes don't lock other updates to these nodes
    # until this, possibly very long, transation ends.
    db().commit()
    return serializer.serialize(
        cluster, nodes,
        ignore_customized=ignore_customized, skip_extensions=skip_extensions
    )