зеркало из https://github.com/microsoft/lisa.git
set value for nodes_raw to avoid regression issue
This commit is contained in:
Родитель
5fe45ee266
Коммит
677dce19fd
|
@ -1155,6 +1155,8 @@ class Environment:
|
|||
|
||||
if self.nodes_raw:
|
||||
for node_raw in self.nodes_raw:
|
||||
if not isinstance(node_raw, dict):
|
||||
node_raw = node_raw.to_dict()
|
||||
node_type = node_raw[constants.TYPE]
|
||||
if node_type == constants.ENVIRONMENTS_NODES_REQUIREMENT:
|
||||
original_req: NodeSpace = load_by_type(NodeSpace, node_raw)
|
||||
|
|
|
@ -1042,12 +1042,14 @@ def load_environment(
|
|||
|
||||
# create mock environment from environments
|
||||
environment_runbook = schema.Environment()
|
||||
if environment_runbook.nodes_raw is None:
|
||||
environment_runbook.nodes_raw = []
|
||||
|
||||
compute_client = get_compute_client(platform)
|
||||
vms = compute_client.virtual_machines.list(resource_group_name)
|
||||
for vm in vms:
|
||||
node_schema = schema.RemoteNode(name=vm.name)
|
||||
environment_runbook.nodes.append(node_schema)
|
||||
environment_runbook.nodes_raw.append(node_schema)
|
||||
|
||||
environments = load_environments(
|
||||
schema.EnvironmentRoot(environments=[environment_runbook])
|
||||
|
|
Загрузка…
Ссылка в новой задаче