diff --git a/inventory_provider/routes/poller.py b/inventory_provider/routes/poller.py index 70a69946a78d07542d37060fcdd9fe3e3c6412d8..70e1ac9ca7973980c42f1318d9b6f7c22b68dd96 100644 --- a/inventory_provider/routes/poller.py +++ b/inventory_provider/routes/poller.py @@ -131,12 +131,16 @@ INTERFACE_LIST_SCHEMA = { 'circuits': { 'type': 'array', 'items': {'$ref': '#/definitions/service'} + }, + 'dashboards': { + 'type': 'array', + 'items': {'enum': [d.name for d in list(BRIAN_DASHBOARDS)]} } }, 'required': [ 'router', 'name', 'description', 'snmp-index', 'bundle', 'bundle-parents', - 'circuits'], + 'circuits', 'dashboards'], 'additionalProperties': False }, }, @@ -382,7 +386,12 @@ def _add_dashboards(interfaces): """ for ifc in interfaces: - ifc['dashboards'] = sorted(list(_get_dashboards(ifc))) + try: + dashboards = _get_dashboards(ifc) + ifc['dashboards'] = sorted(list(d.name for d in dashboards)) + except: + logger.exception('???') + raise yield ifc