a569bf3443
Created from community.general rev. 89ffb04dfff8995f94e9139e7792a116f6467e14 Resolves: rhbz1843859
25 lines
555 B
Python
Executable File
25 lines
555 B
Python
Executable File
#!/usr/bin/python3
|
|
|
|
# Changes namespace, name, and version in Galaxy metadata.
|
|
# Useful for releasing to Automation Hub, where Collections live
|
|
# in namespaces separated from Ansible Galaxy.
|
|
|
|
import sys
|
|
from ruamel.yaml import YAML
|
|
|
|
filepath = "galaxy.yml"
|
|
|
|
buf = open(filepath).read()
|
|
|
|
yaml = YAML(typ="rt")
|
|
yaml.default_flow_style = False
|
|
yaml.preserve_quotes = True
|
|
yaml.indent(mapping=2, sequence=4, offset=2)
|
|
|
|
code = yaml.load(buf)
|
|
|
|
code["namespace"] = sys.argv[1]
|
|
code["name"] = sys.argv[2]
|
|
code["version"] = sys.argv[3]
|
|
yaml.dump(code, sys.stdout)
|