'Update an existing segment.'

@log_helpers.log_method_call
def update_segment(self, context, uuid, segment):

    segment = segment['segment']
    with db_api.context_manager.writer.using(context):
        curr_segment = self._get_segment(context, uuid)
        curr_segment.update_fields(segment)
        curr_segment.update()
    return self._make_segment_dict(curr_segment)
