示例#1
0
文件: cluster.py 项目: tengqm/senlin
    def do_delete(self, context, **kwargs):
        '''Additional logic at the end of cluster deletion process.

        Set cluster status to DELETED.
        '''
        #self.set_status(context, self.DELETED)
        db_api.cluster_delete(context, self.id)
        return True
示例#2
0
    def test_cluster_list_show_deleted(self, notify):
        c = self.eng.cluster_create(self.ctx, 'c-1', 0, self.profile['id'])
        result = self.eng.cluster_list(self.ctx)
        self.assertEqual(1, len(result))
        self.assertEqual(c['id'], result[0]['id'])

        db_api.cluster_delete(self.ctx, c['id'])

        result = self.eng.cluster_list(self.ctx)
        self.assertEqual(0, len(result))

        result = self.eng.cluster_list(self.ctx, show_deleted=True)
        self.assertEqual(1, len(result))
        self.assertEqual(c['id'], result[0]['id'])
示例#3
0
    def test_cluster_list_show_deleted(self, notify):
        c = self.eng.cluster_create(self.ctx, 'c-1', 0, self.profile['id'])
        result = self.eng.cluster_list(self.ctx)
        self.assertEqual(1, len(result))
        self.assertEqual(c['id'], result[0]['id'])

        db_api.cluster_delete(self.ctx, c['id'])

        result = self.eng.cluster_list(self.ctx)
        self.assertEqual(0, len(result))

        result = self.eng.cluster_list(self.ctx, show_deleted=True)
        self.assertEqual(1, len(result))
        self.assertEqual(c['id'], result[0]['id'])
示例#4
0
    def test_cluster_find_show_deleted(self, notify):
        c = self.eng.cluster_create(self.ctx, 'c-1', 0, self.profile['id'])
        cid = c['id']
        db_api.cluster_delete(self.ctx, cid)

        for identity in [cid, cid[:6], 'c-1']:
            self.assertRaises(exception.ClusterNotFound,
                              self.eng.cluster_find, self.ctx, identity)

        # short id and name based finding does not support show_deleted
        for identity in [cid[:6], 'c-1']:
            self.assertRaises(exception.ClusterNotFound,
                              self.eng.cluster_find, self.ctx, identity)

        # ID based finding is okay with show_deleted
        result = self.eng.cluster_find(self.ctx, cid, show_deleted=True)
        self.assertIsNotNone(result)
示例#5
0
    def test_cluster_find_show_deleted(self, notify):
        c = self.eng.cluster_create(self.ctx, 'c-1', 0, self.profile['id'])
        cid = c['id']
        db_api.cluster_delete(self.ctx, cid)

        for identity in [cid, cid[:6], 'c-1']:
            self.assertRaises(exception.ClusterNotFound, self.eng.cluster_find,
                              self.ctx, identity)

        # short id and name based finding does not support show_deleted
        for identity in [cid[:6], 'c-1']:
            self.assertRaises(exception.ClusterNotFound, self.eng.cluster_find,
                              self.ctx, identity)

        # ID based finding is okay with show_deleted
        result = self.eng.cluster_find(self.ctx, cid, show_deleted=True)
        self.assertIsNotNone(result)
示例#6
0
 def delete(cls, context, obj_id):
     db_api.cluster_delete(context, obj_id)
示例#7
0
文件: cluster.py 项目: zzxwill/senlin
    def do_delete(self, context, **kwargs):
        """Additional logic at the end of cluster deletion process."""

        db_api.cluster_delete(context, self.id)
        return True
示例#8
0
    def do_delete(self, context, **kwargs):
        """Additional logic at the end of cluster deletion process."""

        db_api.cluster_delete(context, self.id)
        return True
示例#9
0
文件: cluster.py 项目: jonnary/senlin
 def delete(cls, context, obj_id):
     db_api.cluster_delete(context, obj_id)