How to use the everett.manager.listify function in everett

To help you get started, we’ve selected a few everett examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github willkg / everett / tests / test_manager.py View on Github external
def test_listify(data, expected):
    assert listify(data) == expected
github ansible-community / ara / ara / server / utils.py View on Github external
def __init__(self, possible_paths):
        self.cfg = {}
        possible_paths = listify(possible_paths)

        for path in possible_paths:
            if not path:
                continue

            path = os.path.abspath(os.path.expanduser(path.strip()))
            if path and os.path.isfile(path):
                self.cfg = self.parse_ini_file(path)
                break
github mozilla-iam / sso-dashboard / dashboard / __init__.py View on Github external
def get(self, key, namespace=None):
        # The namespace is either None, a string or a list of
        # strings. This converts it into a list.
        namespace = listify(namespace)
        try:
            if len(namespace) > 0:
                secret = getSecret(
                    name="{}.{}".format(namespace[0], key),
                    context={"app": "sso-dashboard"},
                    region="us-east-1",
                )
            else:
                secret = None
        except ItemNotFound:
            secret = None

        if secret is not None:
            return secret

        return NO_VALUE
github willkg / everett / everett / ext / yamlfile.py View on Github external
def __init__(self, possible_paths):
        self.cfg = {}
        self.path = None
        possible_paths = listify(possible_paths)

        for path in possible_paths:
            if not path:
                continue

            path = os.path.abspath(os.path.expanduser(path.strip()))
            if path and os.path.isfile(path):
                self.path = path
                self.cfg = self.parse_yaml_file(path)
                break

        if not self.path:
            logger.debug("No YAML file found: %s", possible_paths)
github willkg / everett / everett / ext / inifile.py View on Github external
def __init__(self, possible_paths):
        self.cfg = {}
        self.path = None
        possible_paths = listify(possible_paths)

        for path in possible_paths:
            if not path:
                continue

            path = os.path.abspath(os.path.expanduser(path.strip()))
            if path and os.path.isfile(path):
                self.path = path
                self.cfg.update(self.parse_ini_file(path))
                break

        if not self.path:
            logger.debug("No INI file found: %s", possible_paths)