def __get_by_id(id): try: return RunnerType.get_by_id(id) except (ValueError, ValidationError) as e: msg = 'Database lookup for id="%s" resulted in exception. %s' % (id, e) LOG.exception(msg) abort(http_client.NOT_FOUND, msg)
def get_runnertype_by_id(runnertype_id): """ Get RunnerType by id. On error, raise StackStormDBObjectNotFoundError """ try: runnertype = RunnerType.get_by_id(runnertype_id) except (ValueError, ValidationError) as e: LOG.warning('Database lookup for runnertype with id="%s" resulted in ' "exception: %s", runnertype_id, e) raise StackStormDBObjectNotFoundError("Unable to find runnertype with " 'id="%s"' % runnertype_id) return runnertype
def get_runnertype_by_id(runnertype_id): """ Get RunnerType by id. On error, raise StackStormDBObjectNotFoundError """ try: runnertype = RunnerType.get_by_id(runnertype_id) except (ValueError, ValidationError) as e: LOG.warning('Database lookup for runnertype with id="%s" resulted in ' 'exception: %s', runnertype_id, e) raise StackStormDBObjectNotFoundError('Unable to find runnertype with ' 'id="%s"' % runnertype_id) return runnertype