コード例 #1
0
    def test_is_plugin_used(self):
        self._create_test_plugins()
        cluster = self._create_test_cluster()

        plugin = ClusterPlugin.get_connected_plugins(cluster).first()
        self.assertFalse(ClusterPlugin.is_plugin_used(plugin.id))
        ClusterPlugin.set_attributes(cluster.id, plugin.id, enabled=True)
        self.assertTrue(ClusterPlugin.is_plugin_used(plugin.id))
コード例 #2
0
 def validate_delete(cls, data, instance):
     if ClusterPlugin.is_plugin_used(instance.id):
         raise errors.CannotDelete("Can't delete plugin which is enabled "
                                   "for some environment.")
コード例 #3
0
ファイル: plugin.py プロジェクト: huyupeng/fuel-web
 def validate_delete(cls, data, instance):
     if ClusterPlugin.is_plugin_used(instance.id):
         raise errors.CannotDelete(
             "Can't delete plugin which is enabled "
             "for some environment."
         )