riptano / ccm

A script to easily create and destroy an Apache Cassandra cluster on localhost
Apache License 2.0
1.22k stars 303 forks source link

deprecation warnings for PyYAML upon yaml loading #695

Closed smiklosovic closed 5 years ago

smiklosovic commented 5 years ago

Hi,

I am getting these warnings in ccm which subsequently marks tests via pytest (cassandra-dtest uses that) as unstable or "yellow" when using recent version of Python (3.7 for example). Dtest for Cassandra are meant to be used with Python 3 too.

You are using these loadings on various places like

./ccmlib/node.py:158: data = yaml.load(f) ./ccmlib/node.py:1519: data = yaml.load(f) ./ccmlib/node.py:1935: data = yaml.load(f) ./ccmlib/cluster_factory.py:22: data = yaml.load(f) ./ccmlib/dse_node.py:367: data = yaml.load(f) ./ccmlib/dse_node.py:404: data = yaml.load(f) ./ccmlib/common.py:174: return yaml.load(f) ./ccmlib/common.py:568: settings = dict(settings, **yaml.load(s)) ./ccmlib/common.py:695: data = yaml.load(f)

The workaround here is to add "--pythonwarnings=ignore::yaml.YAMLLoadWarning" to pytest but that feels like a hack.

Would you mind to fix this so it loads yamls properly?

(1) https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation

ptnapoleon commented 5 years ago

Fixed on master and cassandra-test branches. Thanks!