Skip to content
Snippets Groups Projects
Commit 63fca204 authored by geant-release-service's avatar geant-release-service
Browse files

Finished release 0.123.

parents f4e1ef2b 89153769
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [0.123] - 2024-06-25
- DBOARD3-965: tmp workaround for nokia parsing error
## [0.122] - 2024-06-20 ## [0.122] - 2024-06-20
- Remove use of functools caching for /msr/services endpoint and reuse fresh data instead - Remove use of functools caching for /msr/services endpoint and reuse fresh data instead
......
...@@ -3,7 +3,6 @@ import re ...@@ -3,7 +3,6 @@ import re
from ncclient import manager, xml_ from ncclient import manager, xml_
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -236,15 +235,16 @@ def get_lags_config(netconf_config): ...@@ -236,15 +235,16 @@ def get_lags_config(netconf_config):
def get_interfaces_config(netconf_config): def get_interfaces_config(netconf_config):
def _get_address_node_info(_e):
# HACKHACK: quick workaround for DBOARD3-965
# TODO: fix this properly
yield from _e.xpath('n:address', namespaces=NS)
yield from _e.xpath('n:primary', namespaces=NS)
def _get_ip_address(e): def _get_ip_address(e):
for details_parent in e: for _address_elem in _get_address_node_info(e):
# example element address = _address_elem[0].text
# <primary> # details_parent - not always primary prefix_length = _address_elem[1].text
# <address>62.40.119.9</address>
# <prefix-length>32</prefix-length>
# </primary>
address = details_parent[0].text
prefix_length = details_parent[1].text
ip_string = f'{address}/{prefix_length}' ip_string = f'{address}/{prefix_length}'
yield ip_string yield ip_string
......
...@@ -2,7 +2,7 @@ from setuptools import setup, find_packages ...@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup( setup(
name='inventory-provider', name='inventory-provider',
version="0.122", version="0.123",
author='GEANT', author='GEANT',
author_email='swd@geant.org', author_email='swd@geant.org',
description='Dashboard inventory provider', description='Dashboard inventory provider',
......
This diff is collapsed.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
import os
from lxml import etree
import pytest
from inventory_provider import nokia
def _load_netconf_config(hostname):
filename = os.path.join(
os.path.dirname(__file__),
'data',
'DBOARD3-965',
f'{hostname}-netconf.xml')
with open(filename) as f:
return etree.fromstring(f.read())
@pytest.mark.parametrize(
'nokia_router_hostname', [
'rt0.lon2.uk.geant.net',
'rt0.lon.uk.geant.net',
'rt0.gen.ch.geant.net',
'rt0.fra.de.geant.net',
'rt0.ams.nl.geant.net'])
def test_DBOARD3_965(nokia_router_hostname):
netconf_doc = _load_netconf_config(hostname=nokia_router_hostname)
for ifc in nokia.get_interfaces_config(netconf_doc):
assert ifc['interface-name'] # trivial sanity check, TODO: proper test
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment