]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
teuthology/beanstalk: workaround yaml load deprecation 1697/head
authorKyr Shatskyy <kyrylo.shatskyy@suse.com>
Wed, 17 Nov 2021 21:49:30 +0000 (22:49 +0100)
committerKyr Shatskyy <kyrylo.shatskyy@suse.com>
Fri, 19 Nov 2021 09:08:21 +0000 (10:08 +0100)
There is a deprecation error when beanstalk parser called:

  YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe

Since beanstalkc3 does not want to apply a fix for that
we can override yaml parser to suppress the error message
from the log.

Fixes: https://tracker.ceph.com/issues/44225
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
teuthology/beanstalk.py

index a1165beccacc778aad25cc902b815e7aeb741f8f..ff3afb6efbd66ac06d0d5bd48920c1ce477f2185 100644 (file)
@@ -18,7 +18,7 @@ def connect():
         raise RuntimeError(
             'Beanstalk queue information not found in {conf_path}'.format(
                 conf_path=config.teuthology_yaml))
-    return beanstalkc.Connection(host=host, port=port)
+    return beanstalkc.Connection(host=host, port=port, parse_yaml=yaml.safe_load)
 
 
 def watch_tube(connection, tube_name):