]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
nuke: s/yaml.load/yaml.safe_load/ 1509/head
authorKefu Chai <kchai@redhat.com>
Wed, 17 Jun 2020 08:48:15 +0000 (16:48 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 17 Jun 2020 08:48:39 +0000 (16:48 +0800)
to silence following warning:

YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.

Signed-off-by: Kefu Chai <kchai@redhat.com>
teuthology/nuke/__init__.py

index e6d141ed83fcf557449189187eb58965259200c6..7d05592772056d624d06335b07e3da4bc2478fa0 100644 (file)
@@ -185,7 +185,7 @@ def main(args):
         ifn = os.path.join(ctx.archive, 'info.yaml')
         if os.path.exists(ifn):
             with open(ifn, 'r') as fd:
-                info = yaml.load(fd.read())
+                info = yaml.safe_load(fd.read())
         if not ctx.pid:
             ctx.pid = info.get('pid')
             if not ctx.pid: