Blame SOURCES/galaxy_transform.py

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