Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/etos_lib/etos.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 Axis Communications AB.
# Copyright 2020-2021 Axis Communications AB.
#
# For a full list of individual contributors, please see the commit history.
#
Expand All @@ -23,6 +23,7 @@
from .lib.utils import Utils
from .lib.http import Http
from .lib.debug import Debug
from .lib.feature_flags import FeatureFlags
from .lib.database import Database
from .lib.secrets import Secrets
from .lib.exceptions import (
Expand All @@ -46,6 +47,7 @@ class ETOS: # pylint: disable=too-many-instance-attributes
__graphql = None
__http = None
__debug = None
__feature_flags = None
__secrets = None
__database = None

Expand Down Expand Up @@ -89,6 +91,13 @@ def debug(self):
self.__debug = Debug()
return self.__debug

@property
def feature_flags(self):
"""Entry for feature flags for ETOS."""
if self.__feature_flags is None:
self.__feature_flags = FeatureFlags()
return self.__feature_flags

@property
def monitor(self):
"""Entry for ETOS Library monitor service."""
Expand Down
25 changes: 25 additions & 0 deletions src/etos_lib/lib/feature_flags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2021 Axis Communications AB.
#
# For a full list of individual contributors, please see the commit history.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""ETOS feature flags."""
import os

class FeatureFlags:
"""Feature flags for ETOS."""

@property
def clm(self):
"""Whether or not CLM sending shall be enabled."""
return os.getenv("ETOS_FEATURE_CLM", "true") == "true"