Skip to content

Commit

Permalink
treewide: make sure we use ruamel.yaml safe variant
Browse files Browse the repository at this point in the history
we have multiple tests failing with the following:
```
>       self.stream.write(data)
E       ValueError: I/O operation on closed file.

../scylla/.local/lib/python3.12/site-packages/ruamel/yaml/emitter.py:1249: ValueError
```

seems like it start when we have calls from multiple thread that might be
updating the same files

trying to switch to the `safe` variant of ruamel.yaml seems to be helping
still not clear how we see it on some of the jobs, and not in all
  • Loading branch information
fruch committed Aug 15, 2024
1 parent 9370f29 commit 4d1c3ba
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ccmlib/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from ccmlib.common import logger
from ccmlib.utils.version import parse_version

yaml = YAML()
yaml = YAML(typ='safe')
yaml.default_flow_style = False

class Cluster(object):
Expand Down
2 changes: 1 addition & 1 deletion ccmlib/cluster_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from ccmlib import repository
from ccmlib.node import Node

yaml = YAML()
yaml = YAML(typ='safe')
yaml.default_flow_style = False

class ClusterFactory():
Expand Down
2 changes: 1 addition & 1 deletion ccmlib/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from botocore import UNSIGNED
from botocore.client import Config

yaml = YAML()
yaml = YAML(typ='safe')
yaml.default_flow_style = False

BIN_DIR = "bin"
Expand Down
2 changes: 1 addition & 1 deletion ccmlib/dse_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from ccmlib import common
from ccmlib.node import Node, NodeError

yaml = YAML()
yaml = YAML(typ='safe')
yaml.default_flow_style = False


Expand Down
2 changes: 1 addition & 1 deletion ccmlib/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from ccmlib.repository import setup
from ccmlib.utils.version import parse_version

yaml = YAML()
yaml = YAML(typ='safe')
yaml.default_flow_style = False

class Status():
Expand Down
2 changes: 1 addition & 1 deletion ccmlib/scylla_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

SNITCH = 'org.apache.cassandra.locator.GossipingPropertyFileSnitch'

yaml = YAML()
yaml = YAML(typ='safe')
yaml.default_flow_style = False

class ScyllaCluster(Cluster):
Expand Down
2 changes: 1 addition & 1 deletion ccmlib/scylla_docker_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

LOGGER = logging.getLogger("ccm")

yaml = YAML()
yaml = YAML(typ='safe')
yaml.default_flow_style = False

class ScyllaDockerCluster(ScyllaCluster):
Expand Down
2 changes: 1 addition & 1 deletion ccmlib/scylla_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from ccmlib.utils.download import download_file, download_version_from_s3, get_url_hash, save_source_file
from ccmlib.utils.version import parse_version

yaml = YAML()
yaml = YAML(typ='safe')
yaml.default_flow_style = False


Expand Down
2 changes: 1 addition & 1 deletion ccmlib/utils/sni_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

logger = logging.getLogger(__name__)

yaml = YAML()
yaml = YAML(typ='safe')
yaml.default_flow_style = False

@contextmanager
Expand Down

0 comments on commit 4d1c3ba

Please sign in to comment.