From: Frank Brehm Date: Thu, 14 Mar 2019 16:13:03 +0000 (+0100) Subject: Avoiding YAML-loader warnings X-Git-Tag: 1.6.4^2~29 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=8d32803f1a58024a79fbe543b1f25c6367fac745;p=pixelpark%2Fpuppetmaster-webhooks.git Avoiding YAML-loader warnings --- diff --git a/lib/webhooks/base_app.py b/lib/webhooks/base_app.py index 299edb7..8302524 100644 --- a/lib/webhooks/base_app.py +++ b/lib/webhooks/base_app.py @@ -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)