Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Scale windows VM bug: catch error for len(vms) < 1 (#2059)
Browse files Browse the repository at this point in the history
* add win config to tests

* catch 0 vms error

* Revert "add win config to tests"

This reverts commit 3ffca42.

* rm comment
  • Loading branch information
Cecile Robert-Michon authored and jackfrancis committed Jan 16, 2018
1 parent 5e39da1 commit 1d33229
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ func (sc *scaleCmd) run(cmd *cobra.Command, args []string) error {
vms, err := sc.client.ListVirtualMachines(sc.resourceGroupName)
if err != nil {
log.Fatalln("failed to get vms in the resource group. Error: %s", err.Error())
} else if len(*vms.Value) < 1 {
log.Fatalln("The provided resource group does not contain any vms.")
}
for _, vm := range *vms.Value {

Expand Down

0 comments on commit 1d33229

Please sign in to comment.