diff --git a/tools/convert_data.py b/tools/convert_data.py index 93af16a3..a4aff691 100644 --- a/tools/convert_data.py +++ b/tools/convert_data.py @@ -8,18 +8,22 @@ new_data = data._service_data services = data.service_dict -for doc in new_data["documents"]: - service = services.get(doc["service_type"]) - if not service: - continue - service_link = service["repositories"][0]["repo"].split('/')[1] - if doc["rst_location"].find("api-ref") >= 0: - doc["rst_location"] = "api-ref/source" - elif doc["rst_location"].find("umn") >= 0: - doc["rst_location"] = "umn/source" - doc["type"] = "umn" - elif doc["rst_location"].find("dev") >= 0: - doc["rst_location"] = "dev_guide/source" +for srv in new_data["services"]: + if len(srv["repositories"]) ==1: + r1 = srv["repositories"][0] + srv["repositories"] = [ + { + "environment": r1["environment"], + "repo": r1["repo"], + "type": r1["type"] + }, + { + "environment": "public", + "repo": 'opentelekomcloud-' + r1["repo"], + "type": "github" + }, + ] + _yaml = YAML() _yaml.indent(mapping=2, sequence=4, offset=2)