diff --git a/src/slice/service/slice_grouper/SliceGrouper.py b/src/slice/service/slice_grouper/SliceGrouper.py index 735d028993eb11e83138caebde1e32ebc830093f..2f1a791819f6a8d0951e9e93ca22d071ea66c1f7 100644 --- a/src/slice/service/slice_grouper/SliceGrouper.py +++ b/src/slice/service/slice_grouper/SliceGrouper.py @@ -29,6 +29,7 @@ class SliceGrouper: def __init__(self) -> None: self._lock = threading.Lock() self._is_enabled = is_slice_grouping_enabled() + LOGGER.info('Slice Grouping: {:s}'.format('ENABLED' if self._is_enabled else 'DISABLED')) if not self._is_enabled: return metrics_exporter = MetricsExporter() diff --git a/src/slice/service/slice_grouper/Tools.py b/src/slice/service/slice_grouper/Tools.py index ca957f3c7760eb65b649d22ecb5b57dee3e08dab..d5a78ba2bb2c8cdaf74af977608427c247bd5913 100644 --- a/src/slice/service/slice_grouper/Tools.py +++ b/src/slice/service/slice_grouper/Tools.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import logging from typing import Dict, List, Optional, Set, Tuple from common.Constants import DEFAULT_CONTEXT_NAME from common.Settings import get_setting @@ -27,7 +28,14 @@ TRUE_VALUES = {'Y', 'YES', 'TRUE', 'T', 'E', 'ENABLE', 'ENABLED'} NO_ISOLATION = IsolationLevelEnum.NO_ISOLATION +LOGGER = logging.getLogger(__name__) + def is_slice_grouping_enabled() -> bool: + # Temporal hack for OFC'23 multi-demo: + metricsdb_hostname = get_setting('METRICSDB_HOSTNAME', default='') + LOGGER.warning('metricsdb_hostname={:s}'.format(str(metricsdb_hostname))) + if '.qdb-sligrp.' in metricsdb_hostname: return True + # end hack is_enabled = get_setting(SETTING_NAME_SLICE_GROUPING, default=None) if is_enabled is None: return False str_is_enabled = str(is_enabled).upper()