Exemple #1
0
    def _retrieve_configuration_from_manager(self):
        """" Retrieves the configuration from the configuration manager

        Args:
        Returns:
        Raises:
        """

        _event_loop = asyncio.get_event_loop()

        cfg_manager = ConfigurationManager(self._storage)

        _event_loop.run_until_complete(
            cfg_manager.create_category(self._CONFIG_CATEGORY_NAME,
                                        self._CONFIG_DEFAULT,
                                        self._CONFIG_CATEGORY_DESCRIPTION))
        self._config_from_manager = _event_loop.run_until_complete(
            cfg_manager.get_category_all_items(self._CONFIG_CATEGORY_NAME))

        self._decode_configuration_from_manager(self._config_from_manager)
Exemple #2
0
def retrieve_configuration(_storage, _category_name, _default, _category_description):
    """Retrieves the configuration from the Category Manager for a category name

     Args:
         _storage: Reference to the Storage Client to be used
         _category_name: Category name to be retrieved
         _default: default values for the category
         _category_description: category description
     Returns:
         _config_from_manager: Retrieved configuration as a Dictionary
     Raises:
     """

    _event_loop = asyncio.get_event_loop()

    cfg_manager = ConfigurationManager(_storage)

    _event_loop.run_until_complete(cfg_manager.create_category(_category_name, _default, _category_description))

    _config_from_manager = _event_loop.run_until_complete(cfg_manager.get_category_all_items(_category_name))

    return _config_from_manager