Handle missing spanloss in PCE without crashing 18/103718/1
authorJonas Mårtensson <jonas.martensson@smartoptics.com>
Wed, 2 Nov 2022 10:05:07 +0000 (10:05 +0000)
committerGilles Thouenon <gilles.thouenon@orange.com>
Tue, 20 Dec 2022 14:28:35 +0000 (15:28 +0100)
commit51d7f4b0c35a124d4087d8c331f5acc2477b3842
treec13d9488c2ec21b725e9bb0186484b9c3566701a
parentadefc5def344748ddb068533bc76ca1c7b9f582d
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