diff --git a/src/common/Constants.py b/src/common/Constants.py index de9ac45a4089a7847c37ceeeeab000f51566a3a3..a6a6899b0342c8e3efcde8e2e26897c1e4734cd3 100644 --- a/src/common/Constants.py +++ b/src/common/Constants.py @@ -58,7 +58,7 @@ class ServiceNameEnum(Enum): CACHING = 'caching' TE = 'te' FORECASTER = 'forecaster' - E2EORCHESTRATOR = 'e2eorchestrator' + E2EORCHESTRATOR = 'e2e-orchestrator' OPTICALCONTROLLER = 'opticalcontroller' BGPLS = 'bgpls-speaker' diff --git a/src/common/Settings.py b/src/common/Settings.py index edc74c776d7818468c0162d26b03698aa3ef25ef..eaeb363adc1d9eadb9ddb0487abef8a0885ce380 100644 --- a/src/common/Settings.py +++ b/src/common/Settings.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging, os, time +import logging, os, re, time from typing import Dict, List from common.Constants import ( DEFAULT_GRPC_BIND_ADDRESS, DEFAULT_GRPC_GRACE_PERIOD, DEFAULT_GRPC_MAX_WORKERS, DEFAULT_HTTP_BIND_ADDRESS, @@ -68,7 +68,8 @@ def get_setting(name, **kwargs): raise Exception('Setting({:s}) not specified in environment or configuration'.format(str(name))) def get_env_var_name(service_name : ServiceNameEnum, env_var_group): - return ('{:s}SERVICE_{:s}'.format(service_name.value, env_var_group)).upper() + service_name = re.sub(r'[^a-zA-Z0-9]', '_', service_name.value) + return ('{:s}SERVICE_{:s}'.format(service_name, env_var_group)).upper() def get_service_host(service_name : ServiceNameEnum): envvar_name = get_env_var_name(service_name, ENVVAR_SUFIX_SERVICE_HOST)