21 lines
437 B
Python
21 lines
437 B
Python
import copy
|
|
|
|
import otc_metadata.services
|
|
from ruamel.yaml import YAML
|
|
|
|
data = otc_metadata.services.Services()
|
|
new_data = data._service_data
|
|
|
|
services = data.service_dict
|
|
|
|
for srv in new_data["services"]:
|
|
srv["teams"] = [
|
|
{"name": f"docs-{srv['service_category']}-rw", "permission": "write"}
|
|
]
|
|
|
|
|
|
_yaml = YAML()
|
|
_yaml.indent(mapping=2, sequence=4, offset=2)
|
|
with open('new.yaml', 'w') as fd:
|
|
_yaml.dump(new_data, fd)
|