From: Frank Brehm Date: Tue, 19 Mar 2019 09:38:44 +0000 (+0100) Subject: Fixing lib/webhooks/base_app.py because of newer version of the 'yaml' module X-Git-Tag: 1.6.4^2~18 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=27dc4561c906c3925b3e676bdf4bb8fa856e33c3;p=pixelpark%2Fpuppetmaster-webhooks.git Fixing lib/webhooks/base_app.py because of newer version of the 'yaml' module --- diff --git a/lib/webhooks/base_app.py b/lib/webhooks/base_app.py index 2c267f8..2a39a3c 100644 --- a/lib/webhooks/base_app.py +++ b/lib/webhooks/base_app.py @@ -652,7 +652,10 @@ class BaseHookApp(BaseApplication): LOG.debug(_("Reading config from {!r} ...").format(f)) config = {} with open(f, 'rb') as fh: - config = yaml.load(fh.read(), Loader=yaml.FullLoader) + if hasattr(yaml, 'FullLoader'): + config = yaml.load(fh.read(), Loader=yaml.FullLoader) + else: + config = yaml.load(fh.read(), Loader=yaml.Loader) if self.verbose > 2: LOG.debug(_("Read config:\n{}").format(pp(config))) if config and isinstance(config, dict):