Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ydb/tools/cfg/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,17 +353,17 @@ def forbid_implicit_storage_pools(self):
def _get_datacenter(self, host_description):
if host_description.get("datacenter") is not None:
return str(host_description.get("datacenter"))
return str(self._walle.get_datacenter(host_description["name"]))
return str(self._walle.get_datacenter(host_description.get("name", host_description.get("host"))))

def _get_rack(self, host_description):
if host_description.get("rack") is not None:
return str(host_description.get("rack"))
return str(self._walle.get_rack(host_description["name"]))
return str(self._walle.get_rack(host_description.get("name", host_description.get("host"))))

def _get_body(self, host_description):
if host_description.get("body") is not None:
return str(host_description.get("body"))
return str(self._walle.get_body(host_description["name"]))
return str(self._walle.get_body(host_description.get("name", host_description.get("host"))))

def _collect_drives_info(self, host_description):
host_config_id = host_description.get("host_config_id", None)
Expand All @@ -381,7 +381,7 @@ def _collect_drives_info(self, host_description):

def __collect_host_info(self, node_id, host_description):
return KiKiMRHost(
hostname=host_description["name"],
hostname=host_description.get("name", host_description.get("host")),
node_id=host_description.get("node_id", node_id),
drives=self._collect_drives_info(host_description),
ic_port=host_description.get("ic_port", DEFAULT_INTERCONNECT_PORT),
Expand Down Expand Up @@ -475,7 +475,7 @@ def accepted_cluster_uuids(self):
def host_configs(self):
converted_host_configs = []
for host_config in self.__cluster_description.get("host_configs", []):
host_config_drives = host_config.get("drives", [])
host_config_drives = host_config.get("drives", host_config.get("drive", []))
converted_host_configs.append(
HostConfig(
host_config_id=host_config["host_config_id"],
Expand Down
19 changes: 16 additions & 3 deletions ydb/tools/cfg/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,22 @@
"type": "integer",
},
"node_id": {"type": "integer", "minLength": 1},
"host": {"type": "string", "minLength": 1},
},
"required": [
"name",
"oneOf": [
{
"additionalProperties": False
},
{
"required": [
"name"
]
},
{
"required": [
"host"
]
}
],
}

Expand Down Expand Up @@ -1012,7 +1025,7 @@


def _host_and_ic_port(host):
return "%s:%s" % (host["name"], str(host.get("ic_port", 19001)))
return "%s:%s" % (host.get("name", host.get("host")), str(host.get("ic_port", 19001)))


def checkNameServiceDuplicates(validator, allow_duplicates, instance, schema):
Expand Down
Loading