Blame SOURCES/galaxy_transform.py

80eadb
#!/usr/bin/python3
80eadb
80eadb
# Changes namespace, name, and version in Galaxy metadata.
80eadb
# Useful for releasing to Automation Hub, where Collections live
80eadb
# in namespaces separated from Ansible Galaxy.
80eadb
80eadb
import sys
80eadb
from ruamel.yaml import YAML
80eadb
80eadb
filepath = "galaxy.yml"
80eadb
80eadb
buf = open(filepath).read()
80eadb
80eadb
yaml = YAML(typ="rt")
80eadb
yaml.default_flow_style = False
80eadb
yaml.preserve_quotes = True
80eadb
yaml.indent(mapping=2, sequence=4, offset=2)
80eadb
80eadb
code = yaml.load(buf)
80eadb
80eadb
code["namespace"] = sys.argv[1]
80eadb
code["name"] = sys.argv[2]
80eadb
code["version"] = sys.argv[3]
80eadb
yaml.dump(code, sys.stdout)