Bug: constraint not correctly interpreted

if name of the constraint input from user is not part of networks names
(typically in the case of excel input), then the program try to find a
name that is clode to the user name and  that is in the network list of
names. This list must not include trnasponder names (because transponder
end points are already listed as constraints and transponder in the
middle of a path are not supported yet)
This will be improved in the PR Ila names in constraints #278
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
This commit is contained in:
EstherLerouzic
2019-09-16 12:13:53 +01:00
parent f990a6c1be
commit 2ba29a78c5
2 changed files with 7 additions and 4 deletions

View File

@@ -248,10 +248,11 @@ def compute_constrained_path(network, req):
total_path = candidate[0]
else:
# TODO: better account for individual oose and strict node
#to ease: suppose that one strict makes the whole liste strict
if 'STRICT' in req.loose_list[:-6]:
# to ease: suppose that one strict makes the whole liste strict (except for the
# last node which is the transceiver)
if 'STRICT' not in req.loose_list[:-6]:
print(f'\x1b[1;33;40m'+f'Request {req.request_id} could not find a path crossing' +\
f'{nodes_list} in network topology'+ '\x1b[0m')
f'{[el.uid for el in nodes_list[:-6]]} in network topology'+ '\x1b[0m')
print(f'constraint ignored')
total_path = dijkstra_path(network, source, destination, weight = 'weight')
else: