Handle missing spanloss in PCE without crashing 15/103515/1
authorJonas Mårtensson <jonas.martensson@smartoptics.com>
Wed, 2 Nov 2022 10:05:07 +0000 (10:05 +0000)
committerJonas Mårtensson <jonas.martensson@smartoptics.com>
Fri, 2 Dec 2022 09:00:40 +0000 (09:00 +0000)
commit21e44f9673e03245340291298869b27bf671497f
tree90115946ec792ab29aaa7b4b28afd27764593a1c
parentd5d2a9e9756c2dc6a296c0ee37cb67ae2f05fae2
Handle missing spanloss in PCE without crashing

If spanloss is missing from OMS attributes in any span in the topology,
the PCE code crashes due to NullPointerException.

- Check for null before accessing spanloss when calculating OSNR

- Set the link to not valid when analyzing the network for path
  computation.

JIRA: TRNSPRTPCE-710

Signed-off-by: Jonas Mårtensson <jonas.martensson@smartoptics.com>
Change-Id: I746cdefc0dd79e914ea235e5ad7801b2c73fc121
pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceLink.java