scylladb / scylla-machine-image

Apache License 2.0
18 stars 25 forks source link

aws: use yaml module for cloud.cfg #487

Closed syuu1228 closed 8 months ago

syuu1228 commented 8 months ago

On latest master, re.sub() is failing since regex pattern is not matched with cloud.cfg on latest Ubuntu image. To avoid such problem, we should use yaml module instead.

syuu1228 commented 8 months ago

Note that, once we rewrite YAML file with yaml.dump(), we lose all comments on the file. That was the reason why we currently using re.sub() instead of yaml module. But I think it’s more important to avoid such build failure.

fruch commented 8 months ago

Note that, once we rewrite YAML file with yaml.dump(), we lose all comments on the file. That was the reason why we currently using re.sub() instead of yaml module. But I think it’s more important to avoid such build failure.

we have the same problem with scylla.yaml as well.

we probably should swith to https://pypi.org/project/ruamel.yaml/ which does preserve comments

yaronkaikov commented 8 months ago

@syuu1228 Running https://jenkins.scylladb.com/job/scylla-master/job/releng-testing/job/ami/234/ to verify it's working. once it pass i will merge

yaronkaikov commented 8 months ago

@syuu1228 Running https://jenkins.scylladb.com/job/scylla-master/job/releng-testing/job/ami/234/ to verify it's working. once it pass i will merge

Passed the problematic phase

syuu1228 commented 8 months ago

we have the same problem with scylla.yaml as well.

we probably should swith to https://pypi.org/project/ruamel.yaml/ which does preserve comments

@fruch Yes, maybe we should try that.