@@ -1685,7 +1685,9 @@ def aks_agentpool_manual_scale_add(cmd,
16851685 operation_group = "managed_clusters" ,
16861686 )
16871687 sizes = [x .strip () for x in vm_sizes .split ("," )]
1688- new_manual_scale_profile = ManualScaleProfile (sizes = sizes , count = int (node_count ))
1688+ if len (sizes ) != 1 :
1689+ raise ClientRequestError ("We only accept single sku size for manual profile." )
1690+ new_manual_scale_profile = ManualScaleProfile (size = sizes [0 ], count = int (node_count ))
16891691 instance .virtual_machines_profile .scale .manual .append (new_manual_scale_profile )
16901692
16911693 return sdk_no_wait (
@@ -1715,19 +1717,25 @@ def aks_agentpool_manual_scale_update(cmd, # pylint: disable=unused-argument
17151717 raise ClientRequestError ("Cannot update manual in a non-virtualmachines node pool." )
17161718
17171719 _current_vm_sizes = [x .strip () for x in current_vm_sizes .split ("," )]
1720+ if len (_current_vm_sizes ) != 1 :
1721+ raise InvalidArgumentValueError (
1722+ f"We only accept single sku size for manual profile. { current_vm_sizes } is invalid."
1723+ )
17181724 _vm_sizes = [x .strip () for x in vm_sizes .split ("," )] if vm_sizes else []
1725+ if len (_vm_sizes ) != 1 :
1726+ raise InvalidArgumentValueError (f"We only accept single sku size for manual profile. { vm_sizes } is invalid." )
17191727 manual_exists = False
17201728 for m in instance .virtual_machines_profile .scale .manual :
1721- if m .sizes == _current_vm_sizes :
1729+ if m .size == _current_vm_sizes [ 0 ] :
17221730 manual_exists = True
17231731 if vm_sizes :
1724- m .sizes = _vm_sizes
1732+ m .size = _vm_sizes [ 0 ]
17251733 if node_count :
17261734 m .count = int (node_count )
17271735 break
17281736 if not manual_exists :
17291737 raise InvalidArgumentValueError (
1730- f"Manual with sizes { current_vm_sizes } doesn't exist in node pool { nodepool_name } "
1738+ f"Manual with size { current_vm_sizes [ 0 ] } doesn't exist in node pool { nodepool_name } "
17311739 )
17321740
17331741 return sdk_no_wait (
@@ -1751,15 +1759,19 @@ def aks_agentpool_manual_scale_delete(cmd, # pylint: disable=unused-argument
17511759 if instance .type_properties_type != CONST_VIRTUAL_MACHINES :
17521760 raise CLIError ("Cannot delete manual in a non-virtualmachines node pool." )
17531761 _current_vm_sizes = [x .strip () for x in current_vm_sizes .split ("," )]
1762+ if len (_current_vm_sizes ) != 1 :
1763+ raise InvalidArgumentValueError (
1764+ f"We only accept single sku size for manual profile. { current_vm_sizes } is invalid."
1765+ )
17541766 manual_exists = False
17551767 for m in instance .virtual_machines_profile .scale .manual :
1756- if m .sizes == _current_vm_sizes :
1768+ if m .size == _current_vm_sizes [ 0 ] :
17571769 manual_exists = True
17581770 instance .virtual_machines_profile .scale .manual .remove (m )
17591771 break
17601772 if not manual_exists :
17611773 raise InvalidArgumentValueError (
1762- f"Manual with sizes { current_vm_sizes } doesn't exist in node pool { nodepool_name } "
1774+ f"Manual with size { current_vm_sizes [ 0 ] } doesn't exist in node pool { nodepool_name } "
17631775 )
17641776
17651777 return sdk_no_wait (
0 commit comments