def routerrule_list(request, **params):
    if 'router_id' in params:
        params['device_id'] = params['router_id']
    if 'router' in request.META:
        router = request.META['router']
    else:
        router = api.router_get(request, params['device_id'])
    try:
        rules = router.router_rules
    except __HOLE__:
        return (False, [])
    return (True, rules)
dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/dashboards/project/routers/extensions/routerrules/rulemanager.py/routerrule_list