コード例 #1
0
 def test_destroy_container_by_uuid(self):
     container = utils.create_test_container(context=self.context)
     dbapi.destroy_container(self.context, container.container_type,
                             container.uuid)
     self.assertRaises(exception.ContainerNotFound,
                       dbapi.get_container_by_uuid, self.context,
                       container.container_type, container.uuid)
コード例 #2
0
ファイル: test_container.py プロジェクト: ppatel826/zun
 def test_destroy_container(self, mock_delete, mock_write, mock_read):
     mock_read.side_effect = etcd.EtcdKeyNotFound
     container = utils.create_test_container(context=self.context)
     mock_read.side_effect = lambda *args: FakeEtcdResult(container.as_dict(
     ))
     dbapi.destroy_container(self.context, container.uuid)
     mock_delete.assert_called_once_with('/containers/%s' % container.uuid)
コード例 #3
0
ファイル: test_container.py プロジェクト: openstack/higgins
 def test_destroy_container_by_uuid(self):
     container = utils.create_test_container(context=self.context)
     dbapi.destroy_container(self.context, container.container_type,
                             container.uuid)
     self.assertRaises(exception.ContainerNotFound,
                       dbapi.get_container_by_uuid,
                       self.context, container.container_type,
                       container.uuid)
コード例 #4
0
ファイル: container.py プロジェクト: wanghuiict/zun
    def destroy(self, context=None):
        """Delete the Container from the DB.

        :param context: Security context. NOTE: This should only
                        be used internally by the indirection_api.
                        Unfortunately, RPC requires context as the first
                        argument, even though we don't use it.
                        A context should be set when instantiating the
                        object, e.g.: Container(context)
        """
        dbapi.destroy_container(context, self.container_type, self.uuid)
        self.obj_reset_changes()
コード例 #5
0
ファイル: container.py プロジェクト: openstack/higgins
    def destroy(self, context=None):
        """Delete the Container from the DB.

        :param context: Security context. NOTE: This should only
                        be used internally by the indirection_api.
                        Unfortunately, RPC requires context as the first
                        argument, even though we don't use it.
                        A context should be set when instantiating the
                        object, e.g.: Container(context)
        """
        dbapi.destroy_container(context, self.container_type, self.uuid)
        self.obj_reset_changes()