Skip to content

Commit

Permalink
Fixed logic check
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi1693 committed Apr 24, 2022
1 parent 0e7cca1 commit 3abfb3c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/saltext/vmware/utils/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ def list_vms(
)
properties.append("runtime.host")
log.trace("Retrieved host: %s", host)
else:
host = None

# Search for the objects
vms = utils_common.get_mors_with_properties(
Expand All @@ -374,13 +376,11 @@ def list_vms(

items = []
for vm in vms:
if host_name:
if host == vm["runtime.host"]:
if not vm["config"].template:
if host_name and host == vm["runtime.host"]:
items.append(vm["name"])
else:
break
if not vm["config"].template:
items.append(vm["name"])
items.append(vm["name"])
return items


Expand Down

0 comments on commit 3abfb3c

Please sign in to comment.