]> Frank Brehm's Git Trees - pixelpark/puppetmaster-webhooks.git/commitdiff
Fixing lib/webhooks/base_app.py because of newer version of the 'yaml' module
authorFrank Brehm <frank.brehm@pixelpark.com>
Tue, 19 Mar 2019 09:38:44 +0000 (10:38 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Tue, 19 Mar 2019 09:38:44 +0000 (10:38 +0100)
lib/webhooks/base_app.py

index 2c267f85c7a01995fc7c770f0ad34cd40ee39b2d..2a39a3cef9cb883967b0ac1acd6a10543891020a 100644 (file)
@@ -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):