当前位置: 首页>>代码示例>>Python>>正文


Python objects.ClusterPlugins类代码示例

本文整理汇总了Python中nailgun.objects.ClusterPlugins的典型用法代码示例。如果您正苦于以下问题:Python ClusterPlugins类的具体用法?Python ClusterPlugins怎么用?Python ClusterPlugins使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ClusterPlugins类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

    def setUp(self):
        super(TestNailgunReceiver, self).setUp()

        self.env.create(
            status=consts.CLUSTER_STATUSES.operational,
            nodes_kwargs=[
                {'roles': ['controller'],
                 'status': consts.NODE_STATUSES.ready}])
        self.cluster = self.env.clusters[0]

        for i in range(2):
            meta = self.env.get_default_plugin_metadata(
                name='name{0}'.format(i),
                title='title{0}'.format(i),
                description='description{0}'.format(i))

            self.plugin = Plugin.create(meta)
            self.cluster.plugins.append(self.plugin)
            ClusterPlugins.set_attributes(self.cluster.id,
                                          self.plugin.id,
                                          enabled=True)

        self.task = self.env.create_task(
            name=consts.TASK_NAMES.deployment,
            status=consts.TASK_STATUSES.ready,
            cluster_id=self.cluster.id)
开发者ID:dnikishov,项目名称:fuel-web,代码行数:26,代码来源:test_receiver.py

示例2: test_is_plugin_used

    def test_is_plugin_used(self):
        self._create_test_plugins()
        cluster = self._create_test_cluster()

        plugin = ClusterPlugins.get_connected_plugins(cluster).first()
        self.assertFalse(ClusterPlugins.is_plugin_used(plugin.id))
        ClusterPlugins.set_attributes(cluster.id, plugin.id, enabled=True)
        self.assertTrue(ClusterPlugins.is_plugin_used(plugin.id))
开发者ID:vangogh-ken,项目名称:fuel-web,代码行数:8,代码来源:test_object_plugin.py

示例3: test_get_enabled

    def test_get_enabled(self):
        self._create_test_plugins()
        cluster = self._create_test_cluster()

        plugin = ClusterPlugins.get_connected_plugins(cluster).first()
        ClusterPlugins.set_attributes(cluster.id, plugin.id, enabled=True)

        enabled_plugin = ClusterPlugins.get_enabled(cluster.id).first()
        self.assertEqual(plugin.id, enabled_plugin.id)
开发者ID:vangogh-ken,项目名称:fuel-web,代码行数:9,代码来源:test_object_plugin.py

示例4: test_get_enabled

    def test_get_enabled(self):
        self._create_test_plugins()
        cluster = self._create_test_cluster()

        plugin_id = ClusterPlugins.get_connected_plugins(cluster.id)[0][0]
        ClusterPlugins.set_attributes(cluster.id, plugin_id, enabled=True)

        enabled_plugin = ClusterPlugins.get_enabled(cluster.id)[0].id
        self.assertEqual(enabled_plugin, plugin_id)
开发者ID:gitfred,项目名称:fuel-web,代码行数:9,代码来源:test_object_plugin.py

示例5: test_get_enabled_plugins

    def test_get_enabled_plugins(self):
        plugin_a = self._create_plugin(**self._compat_meta)
        plugin_b = self._create_plugin(**self._compat_meta)

        ClusterPlugins.set_attributes(
            self.cluster.id, plugin_a.id, enabled=True)

        compat_plugins = ClusterPlugins.get_compatible_plugins(self.cluster)
        self.assertItemsEqual(compat_plugins, [plugin_a, plugin_b])

        enabled_plugins = ClusterPlugins.get_enabled(self.cluster.id)
        self.assertItemsEqual(enabled_plugins, [plugin_a])
开发者ID:gdyuldin,项目名称:fuel-web,代码行数:12,代码来源:test_plugin_manager.py

示例6: test_set_plugin_attributes

    def test_set_plugin_attributes(self):
        meta = base.reflect_db_metadata()
        self._create_test_plugins()
        cluster = self._create_test_cluster()

        plugin = ClusterPlugins.get_connected_plugins(cluster).first()
        ClusterPlugins.set_attributes(cluster.id, plugin.id, enabled=True)

        columns = meta.tables['cluster_plugins'].c
        enabled = self.db.execute(
            sa.select([columns.enabled])
            .where(columns.cluster_id == cluster.id)
            .where(columns.plugin_id == plugin.id)
        ).fetchone()
        self.assertTrue(enabled[0])
开发者ID:vangogh-ken,项目名称:fuel-web,代码行数:15,代码来源:test_object_plugin.py

示例7: test_get_connected_clusters

 def test_get_connected_clusters(self):
     plugin_id = self._create_test_plugins()[0]
     for _ in range(2):
         self._create_test_cluster()
     number_of_connected_clusters =\
         ClusterPlugins.get_connected_clusters(plugin_id).count()
     self.assertEqual(2, number_of_connected_clusters)
开发者ID:vangogh-ken,项目名称:fuel-web,代码行数:7,代码来源:test_object_plugin.py

示例8: test_get_connected_for_specific_plugins

 def test_get_connected_for_specific_plugins(self):
     plugin_ids = self._create_test_plugins()
     cluster = self._create_test_cluster()
     number_of_connected_plugins =\
         ClusterPlugins.get_connected_plugins(
             cluster, plugin_ids[1:]).count()
     self.assertEqual(4, number_of_connected_plugins)
开发者ID:vangogh-ken,项目名称:fuel-web,代码行数:7,代码来源:test_object_plugin.py

示例9: test_get_connected_clusters

 def test_get_connected_clusters(self):
     plugin_id = self._create_test_plugins()[0]
     for _ in range(2):
         self._create_test_cluster()
     connected_clusters =\
         ClusterPlugins.get_connected_clusters(plugin_id).all()
     self.assertEqual(len(connected_clusters), 2)
开发者ID:gitfred,项目名称:fuel-web,代码行数:7,代码来源:test_object_plugin.py

示例10: test_get_compatible_plugins_for_new_cluster

    def test_get_compatible_plugins_for_new_cluster(self):
        plugin_a = self._create_plugin(**self._compat_meta)
        plugin_b = self._create_plugin(**self._compat_meta)
        self._create_plugin(**self._uncompat_meta)

        cluster = self.env.create(
            cluster_kwargs={
                'release_id': self.cluster.release.id,
                'mode': consts.CLUSTER_MODES.ha_compact,
            })

        compat_plugins = ClusterPlugins.get_compatible_plugins(cluster)
        self.assertItemsEqual(compat_plugins, [plugin_a, plugin_b])
开发者ID:ekorekin,项目名称:fuel-web,代码行数:13,代码来源:test_plugin_manager.py

示例11: test_enable_plugins_by_component

    def test_enable_plugins_by_component(self):
        self.env.create_plugin(
            name='plugin_with_test_storage',
            package_version='4.0.0',
            fuel_version=['8.0'],
            releases=[{
                'repository_path': 'repositories/ubuntu',
                'version': '2015.1-8.3',
                'os': 'ubuntu',
                'mode': ['ha'],
                'deployment_scripts_path': 'deployment_scripts/'}],
            components_metadata=self.env.get_default_components(
                name='storage:test_storage'))

        plugin = self.env.create_plugin(
            version='1.0.0',
            name='plugin_with_test_storage',
            package_version='4.0.0',
            fuel_version=['8.0'],
            releases=[{
                'repository_path': 'repositories/ubuntu',
                'version': '2015.1-8.3',
                'os': 'ubuntu',
                'mode': ['ha'],
                'deployment_scripts_path': 'deployment_scripts/'}],
            components_metadata=self.env.get_default_components(
                name='storage:test_storage'))

        cluster = self.env.create(
            release_kwargs={
                'operating_system': consts.RELEASE_OS.ubuntu,
                'version': '2015.1-8.3'},
            cluster_kwargs={
                'mode': consts.CLUSTER_MODES.ha_compact,
                'api': False,
                'components': [
                    'hypervisor:test_hypervisor',
                    'storage:test_storage']})

        enabled_plugins = ClusterPlugins.get_enabled(cluster.id)
        self.assertItemsEqual([plugin], enabled_plugins)
开发者ID:ogelbukh,项目名称:fuel-web,代码行数:41,代码来源:test_plugin_manager.py

示例12: test_get_all_connected_plugins

 def test_get_all_connected_plugins(self):
     self._create_test_plugins()
     cluster = self._create_test_cluster()
     number_of_connected_plugins =\
         ClusterPlugins.get_connected_plugins(cluster).count()
     self.assertEqual(5, number_of_connected_plugins)
开发者ID:vangogh-ken,项目名称:fuel-web,代码行数:6,代码来源:test_object_plugin.py

示例13: test_get_connected_plugins_data

 def test_get_connected_plugins_data(self):
     self._create_test_plugins()
     cluster = self._create_test_cluster()
     number_of_connected_plugins_data_items =\
         ClusterPlugins.get_connected_plugins_data(cluster.id).count()
     self.assertEqual(5, number_of_connected_plugins_data_items)
开发者ID:vangogh-ken,项目名称:fuel-web,代码行数:6,代码来源:test_object_plugin.py

示例14: test_get_connected_plugins

 def test_get_connected_plugins(self):
     self._create_test_plugins()
     cluster = self._create_test_cluster()
     connected_plugins =\
         ClusterPlugins.get_connected_plugins(cluster.id).all()
     self.assertEqual(len(connected_plugins), 5)
开发者ID:gitfred,项目名称:fuel-web,代码行数:6,代码来源:test_object_plugin.py

示例15: test_get_compatible_plugins

    def test_get_compatible_plugins(self):
        plugin_a = self._create_plugin(**self._compat_meta)
        self._create_plugin(**self._uncompat_meta)

        compat_plugins = ClusterPlugins.get_compatible_plugins(self.cluster)
        self.assertItemsEqual(compat_plugins, [plugin_a])
开发者ID:gdyuldin,项目名称:fuel-web,代码行数:6,代码来源:test_plugin_manager.py


注:本文中的nailgun.objects.ClusterPlugins类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。