

def update(self, object):
    if (object is None):
        raise BadRequest('Object not present')
    if ((not hasattr(object, '_id')) or (not hasattr(object, '_rev'))):
        raise BadRequest("Object does not have required '_id' or '_rev' attribute")
    res_obj = self.read(object._id)
    object.ts_updated = get_ion_ts()
    if ((res_obj.lcstate != object.lcstate) or (res_obj.availability != object.availability)):
        log.warn(('Cannot modify %s life cycle state or availability in update current=%s/%s given=%s/%s. ' + 'DO NOT REUSE THE SAME OBJECT IN CREATE THEN UPDATE'), type(res_obj).__name__, res_obj.lcstate, res_obj.availability, object.lcstate, object.availability)
        object.lcstate = res_obj.lcstate
        object.availability = res_obj.availability
    self.event_pub.publish_event(event_type='ResourceModifiedEvent', origin=object._id, origin_type=object.type_, sub_type='UPDATE', mod_type=ResourceModificationType.UPDATE)
    return self.rr_store.update(object)

dataset/ETHPy150Open ooici/pyon/pyon/ion/resregistry.py ResourceRegistry.update/original