Skip to content

Commit 8d0dbbb

Browse files
committed
dev
1 parent e0cdd8c commit 8d0dbbb

File tree

1 file changed

+8
-3
lines changed
  • src/azure-cli/azure/cli/command_modules/vm

1 file changed

+8
-3
lines changed

src/azure-cli/azure/cli/command_modules/vm/custom.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,8 +1665,9 @@ def resize_vm(cmd, resource_group_name, vm_name, size, no_wait=False):
16651665
from .operations.vm import VMUpdate as _VMUpdate, VMShow as _VMShow
16661666

16671667
class VMUpdate(_VMUpdate):
1668-
def __init__(self):
1669-
self._skip_update = None
1668+
def __init__(self, cli_ctx):
1669+
super().__init__(cli_ctx=cli_ctx)
1670+
self._skip_update = False
16701671

16711672
def pre_instance_update(self, instance):
16721673
current_size = instance.properties.hardware_profile.vm_size
@@ -1683,15 +1684,19 @@ def pre_instance_update(self, instance):
16831684
if current_size_str == size:
16841685
logger.warning("VM is already %s", size)
16851686
self._skip_update = True
1686-
return
1687+
return instance
16871688

16881689
instance.properties.hardware_profile.vm_size = size
16891690
logger.info("Resizing VM from %s to %s", current_size_str, size)
1691+
return instance
16901692

16911693
def post_operations(self, *args, **kwargs):
16921694
if getattr(self, "_skip_update", False):
16931695
return None
16941696

1697+
if no_wait:
1698+
return None
1699+
16951700
return _VMShow(cli_ctx=cmd.cli_ctx)(command_args={
16961701
'vm_name': vm_name,
16971702
'resource_group': resource_group_name,

0 commit comments

Comments
 (0)