Skip to content

Commit

Permalink
Fix VM Scale Set Fetch and Commands (#134)
Browse files Browse the repository at this point in the history
* Fixed VMSS fetcher
* Fixed VM Scale Set Run Command

Signed-off-by: GavinHC <[email protected]>
  • Loading branch information
gavinhc authored Feb 24, 2022
1 parent 377a356 commit 7ac0ef4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
4 changes: 2 additions & 2 deletions chaosazure/common/compute/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ def run(resource_group: str, compute: dict, timeout: int, parameters: dict,

compute_type = compute.get('type').lower()
if compute_type == RES_TYPE_VMSS_VM.lower():
poller = client.virtual_machine_scale_set_vms.run_command(
poller = client.virtual_machine_scale_set_vms.begin_run_command(
resource_group, compute['scale_set'],
compute['instance_id'], parameters)

elif compute_type == RES_TYPE_VM.lower():
poller = client.virtual_machines.run_command(
poller = client.virtual_machines.begin_run_command(
resource_group, compute['name'], parameters)

else:
Expand Down
13 changes: 1 addition & 12 deletions chaosazure/vmss/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,9 @@ def fetch_vmss(filter, configuration, secrets) -> List[dict]:
# Private helper functions
#############################################################################
def __fetch_vmss_instances(choice, configuration, secrets) -> List[Dict]:
vmss_instances = []
client = init_compute_management_client(secrets, configuration)
pages = client.virtual_machine_scale_set_vms.list(
vmss_instances = client.virtual_machine_scale_set_vms.list(
choice['resourceGroup'], choice['name'])
first_page = pages.advance_page()
vmss_instances.extend(list(first_page))

while True:
try:
page = pages.advance_page()
vmss_instances.extend(list(page))
except StopIteration:
break

results = __parse_vmss_instances_result(vmss_instances, choice)
return results

Expand Down

0 comments on commit 7ac0ef4

Please sign in to comment.