예제 #1
0
 def test_host_delete(self):
     ctxt = context.get_admin_context()
     result = self._create_host(self._get_fake_values())
     db.host_delete(ctxt, result['uuid'])
     self.assertRaises(exception.HostNotFound,
                       db.host_get_by_uuid, self.ctxt,
                       uuidsentinel.fake_uuid)
예제 #2
0
파일: host.py 프로젝트: rkmrHonjo/masakari
    def destroy(self):
        if not self.obj_attr_is_set('id'):
            raise exception.ObjectActionError(action='destroy',
                                              reason='already destroyed')
        if not self.obj_attr_is_set('uuid'):
            raise exception.ObjectActionError(action='destroy',
                                              reason='no uuid')

        db.host_delete(self._context, self.uuid)
        delattr(self, base.get_attrname('id'))
예제 #3
0
    def destroy(self):
        if not self.obj_attr_is_set('id'):
            raise exception.ObjectActionError(action='destroy',
                                              reason='already destroyed')
        if not self.obj_attr_is_set('uuid'):
            raise exception.ObjectActionError(action='destroy',
                                              reason='no uuid')

        db.host_delete(self._context, self.uuid)
        delattr(self, base.get_attrname('id'))
예제 #4
0
파일: host.py 프로젝트: openstack/masakari
    def destroy(self):
        if not self.obj_attr_is_set('id'):
            raise exception.ObjectActionError(action='destroy',
                                              reason='already destroyed')
        if not self.obj_attr_is_set('uuid'):
            raise exception.ObjectActionError(action='destroy',
                                              reason='no uuid')

        api_utils.notify_about_host_api(self._context, self,
            action=fields.EventNotificationAction.HOST_DELETE,
            phase=fields.EventNotificationPhase.START)

        db.host_delete(self._context, self.uuid)

        api_utils.notify_about_host_api(self._context, self,
            action=fields.EventNotificationAction.HOST_DELETE,
            phase=fields.EventNotificationPhase.END)

        delattr(self, base.get_attrname('id'))
예제 #5
0
파일: host.py 프로젝트: iorchard/okidoki
    def destroy(self):
        if not self.obj_attr_is_set('id'):
            raise exception.ObjectActionError(action='destroy',
                                              reason='already destroyed')
        if not self.obj_attr_is_set('uuid'):
            raise exception.ObjectActionError(action='destroy',
                                              reason='no uuid')

        api_utils.notify_about_host_api(
            self._context,
            self,
            action=fields.EventNotificationAction.HOST_DELETE,
            phase=fields.EventNotificationPhase.START)

        db.host_delete(self._context, self.uuid)

        api_utils.notify_about_host_api(
            self._context,
            self,
            action=fields.EventNotificationAction.HOST_DELETE,
            phase=fields.EventNotificationPhase.END)

        delattr(self, base.get_attrname('id'))