Ejemplo n.º 1
0
    def _set_share_group_error_state(self,
                                     method,
                                     context,
                                     ex,
                                     request_spec,
                                     action=None):
        LOG.warning("Failed to schedule_%(method)s: %(ex)s", {
            "method": method,
            "ex": ex
        })

        share_group_state = {'status': constants.STATUS_ERROR}

        share_group_id = request_spec.get('share_group_id')

        if share_group_id:
            db.share_group_update(context, share_group_id, share_group_state)

        if action:
            self.message_api.create(
                context,
                action,
                context.project_id,
                resource_type=message_field.Resource.SHARE_GROUP,
                resource_id=share_group_id,
                exception=ex)
Ejemplo n.º 2
0
    def _set_share_group_error_state(self, method, context, ex, request_spec):
        LOG.warning(_LW("Failed to schedule_%(method)s: %(ex)s"),
                    {"method": method, "ex": ex})

        share_group_state = {'status': constants.STATUS_ERROR}

        share_group_id = request_spec.get('share_group_id')

        if share_group_id:
            db.share_group_update(context, share_group_id, share_group_state)
Ejemplo n.º 3
0
    def _set_share_group_error_state(self, method, context, ex, request_spec):
        LOG.warning(_LW("Failed to schedule_%(method)s: %(ex)s"), {
            "method": method,
            "ex": ex
        })

        share_group_state = {'status': constants.STATUS_ERROR}

        share_group_id = request_spec.get('share_group_id')

        if share_group_id:
            db.share_group_update(context, share_group_id, share_group_state)
Ejemplo n.º 4
0
def share_group_update_db(context, share_group_id, host):
    '''Set the host and set the updated_at field of a share group.

    :returns: A share group with the updated fields set properly.
    '''
    now = timeutils.utcnow()
    values = {'host': host, 'updated_at': now}
    return db.share_group_update(context, share_group_id, values)
Ejemplo n.º 5
0
    def _set_share_group_error_state(self, method, context, ex,
                                     request_spec, action=None):
        LOG.warning("Failed to schedule_%(method)s: %(ex)s",
                    {"method": method, "ex": ex})

        share_group_state = {'status': constants.STATUS_ERROR}

        share_group_id = request_spec.get('share_group_id')

        if share_group_id:
            db.share_group_update(context, share_group_id, share_group_state)

        if action:
            self.message_api.create(
                context, action, context.project_id,
                resource_type=message_field.Resource.SHARE_GROUP,
                resource_id=share_group_id, exception=ex)
Ejemplo n.º 6
0
def share_group_update_db(context, share_group_id, host):
    '''Set the host and set the updated_at field of a share group.

    :returns: A share group with the updated fields set properly.
    '''
    now = timeutils.utcnow()
    values = {'host': host, 'updated_at': now}
    return db.share_group_update(context, share_group_id, values)
Ejemplo n.º 7
0
 def _update(self, *args, **kwargs):
     db.share_group_update(*args, **kwargs)