mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-11-02 19:18:02 +00:00
Add a ServiceError(Exception) for malformed user requests
For example requested bandwidth should be >0 Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
This commit is contained in:
@@ -30,7 +30,8 @@ from gnpy.core.request import (Path_request, Result_element, compute_constrained
|
||||
requests_aggregation, propagate_and_optimize_mode,
|
||||
BLOCKING_NOPATH, BLOCKING_NOMODE, BLOCKING_NOSPECTRUM,
|
||||
find_reversed_path)
|
||||
from gnpy.core.exceptions import ConfigurationError, EquipmentConfigError, NetworkTopologyError
|
||||
from gnpy.core.exceptions import (ConfigurationError, EquipmentConfigError, NetworkTopologyError,
|
||||
ServiceError)
|
||||
import gnpy.core.ansi_escapes as ansi_escapes
|
||||
from gnpy.core.spectrum_assignment import (build_oms_list, reversed_oms, spectrum_selection,
|
||||
pth_assign_spectrum)
|
||||
@@ -363,6 +364,9 @@ if __name__ == '__main__':
|
||||
except ConfigurationError as e:
|
||||
print(f'{ansi_escapes.red}Configuration error:{ansi_escapes.reset} {e}')
|
||||
exit(1)
|
||||
except ServiceError as e:
|
||||
print(f'{ansi_escapes.red}Service error:{ansi_escapes.reset} {e}')
|
||||
exit(1)
|
||||
|
||||
# Build the network once using the default power defined in SI in eqpt config
|
||||
# TODO power density: db2linp(ower_dbm": 0)/power_dbm": 0 * nb channels as defined by
|
||||
|
||||
Reference in New Issue
Block a user