Skip to content

Commit

Permalink
resize: fix type error
Browse files Browse the repository at this point in the history
The original load_by_type transforms the type to common capability, so
the test lisa fails on checking requirement later. Use deep copy to keep
original types.
  • Loading branch information
Chi Song authored and squirrelsc committed Jan 24, 2022
1 parent 1deec7f commit c45c6cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lisa/sut_orchestrator/azure/features.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

import copy
import re
from dataclasses import dataclass
from os import unlink
Expand Down Expand Up @@ -814,10 +815,9 @@ def resize(
wait_operation(lro_poller, time_out=300)

self._node.close()
self._node.capability = schema.load_by_type(
schema.Capability, new_vm_size_info.capability
)
return new_vm_size_info.capability
new_capability = copy.deepcopy(new_vm_size_info.capability)
self._node.capability = cast(schema.Capability, new_capability)
return new_capability

def _select_vm_size(
self, resize_action: ResizeAction = ResizeAction.IncreaseCoreCount
Expand Down

0 comments on commit c45c6cc

Please sign in to comment.