]> Frank Brehm's Git Trees - pixelpark/puppetmaster-webhooks.git/commitdiff
Avoiding YAML-loader warnings
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 14 Mar 2019 16:13:03 +0000 (17:13 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 14 Mar 2019 16:13:03 +0000 (17:13 +0100)
lib/webhooks/base_app.py

index 299edb7a0bf513ea753c54efaaf3e2d5ee500b0f..8302524966cfe6f96460f9e44fcf1fbba7304fd4 100644 (file)
@@ -648,7 +648,7 @@ class BaseHookApp(BaseApplication):
             LOG.debug(_("Reading config from {!r} ...").format(f))
         config = {}
         with open(f, 'rb') as fh:
-            config = yaml.load(fh.read())
+            config = yaml.load(fh.read(), Loader=yaml.FullLoader)
         if self.verbose > 2:
             LOG.debug(_("Read config:\n{}").format(pp(config)))
         if config and isinstance(config, dict):
@@ -1234,7 +1234,7 @@ class BaseHookApp(BaseApplication):
         LOG.debug("Reading {!r} ...".format(str(self.cachefile)))
         try:
             with open(str(self.cachefile), 'r', **self.open_args) as fh:
-                for struct in yaml.load(fh):
+                for struct in yaml.load(fh, Loader=yaml.FullLoader):
                     module_info = ModuleInfo.init_from_data(
                         struct, appname=self.appname, verbose=self.verbose,
                         base_dir=self.base_dir)