You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.1 KiB

# Copyright (C) 2005-2024 Splunk Inc. All Rights Reserved.
from itsi_py3 import _
import itsi_py3
import splunk.bundle as bundle
from ITOA.setup_logging import getLogger
from .state.statestore import FeatureFlaggingStateStore
from feature_flagging.cloud_state_maintainer import CloudStateMaintainer
from .suite_content import SuiteContent
from .abstract_suite_retriever import AbstractSuiteRetriever
class CloudConfigSuiteRetriever(AbstractSuiteRetriever):
def __init__(self, session_key):
self.logger = getLogger(logger_name='itsi.feature_flagging.CloudConfigSuiteRetriever')
self.session_key = session_key
def get_suite(self):
"""
Gets suite from Suitification State Store
@return: suite name
"""
state = self._get_state()
assert state is not None, "Suitification State is expected to be defined"
return state.get_suite()
def _get_state(self):
return FeatureFlaggingStateStore(self.session_key).get_state()
def sync_suite_state(self):
CloudStateMaintainer(self.session_key).maintain_state()