def delete_gerrit(gerrit_id): """ Deletes a gerrit instance :param gerrit_id: The ID of the gerrit instance. """ gerrit = Gerrit() try: gerrit.load(str(gerrit_id)) except DoesNotExist as err: return {'errors': {'gerrit_id': str(err)}} gerrit.delete() return {'success': True}
def delete_gerrit(gerrit_id): """ Deletes a gerrit instance :param gerrit_id: The ID of the gerrit instance. """ gerrit = Gerrit() try: gerrit.load(str(gerrit_id)) except DoesNotExist as err: cla.log.warning( 'a gerrit instance does not exist with the ' 'given Gerrit ID: {} - unable to delete'.format(gerrit_id)) return {'errors': {'gerrit_id': str(err)}} gerrit.delete() cla.log.debug( 'deleted gerrit instance with gerrit_id: {}'.format(gerrit_id)) return {'success': True}