diff --git a/README.md b/README.md index 8a48607..c5d73a4 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ which will be processed in the following order (last wins): - default config (build-in) - global config file (this will depend on your operating system) -- folderbased config file (`.later` file in current working folder) +- folderbased config file (`.later.yml` file in current working folder) - cli options Be careful! YAML Attributes will be overwritten while lists in any @@ -80,6 +80,7 @@ will ignore `exclude_files` and `ignore_dotfiles` options. #### Default settings ```YAML +--- ansible: # Add the name of used custom ansible modules. # Otherwise ansible-later can't detect unknown modules diff --git a/ansiblelater/settings.py b/ansiblelater/settings.py index bf12f29..15a61cb 100644 --- a/ansiblelater/settings.py +++ b/ansiblelater/settings.py @@ -54,7 +54,7 @@ class Settings(object): # Override correct log level from argparse levels = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] - log_level = levels.index(logging.getLevelName(defaults["logging"]["level"])) + log_level = levels.index(defaults["logging"]["level"]) if tmp_dict.get("logging"): for adjustment in tmp_dict["logging"]["level"]: log_level = min(len(levels) - 1, max(log_level + adjustment, 0)) @@ -72,7 +72,8 @@ class Settings(object): defaults = self._get_defaults() source_files = [] source_files.append(self.config_file) - source_files.append(os.path.relpath(os.path.normpath(os.path.join(os.getcwd(), ".later")))) + source_files.append(os.path.relpath( + os.path.normpath(os.path.join(os.getcwd(), ".later.yml")))) cli_options = self.args for config in source_files: @@ -80,6 +81,7 @@ class Settings(object): with utils.open_file(config) as stream: s = stream.read() sdict = utils.safe_load(s) + sdict["logging"]["level"] = sdict["logging"]["level"].upper() if self._validate(sdict): anyconfig.merge(defaults, sdict, ac_merge=anyconfig.MS_DICTS) @@ -98,7 +100,7 @@ class Settings(object): "exclude_files": [] }, "logging": { - "level": logging.getLevelName("WARNING"), + "level": logging.getLevelName(30), "json": False }, "ansible": {