mirror of
https://github.com/vmware/vsphere-automation-sdk-python.git
synced 2024-11-26 11:19:59 -05:00
Modified according to review comments.
This commit is contained in:
parent
2ecbca4718
commit
9a4e62b90a
@ -13,6 +13,7 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import atexit
|
import atexit
|
||||||
|
import json
|
||||||
from samples.vsphere.common import vapiconnect
|
from samples.vsphere.common import vapiconnect
|
||||||
from samples.vsphere.common.sample_util import parse_cli_args
|
from samples.vsphere.common.sample_util import parse_cli_args
|
||||||
from samples.vsphere.common.sample_util import pp
|
from samples.vsphere.common.sample_util import pp
|
||||||
@ -44,22 +45,17 @@ def run():
|
|||||||
"""
|
"""
|
||||||
vm_svc = VM(stub_config)
|
vm_svc = VM(stub_config)
|
||||||
list_of_vms = vm_svc.list()
|
list_of_vms = vm_svc.list()
|
||||||
print "----------------------------"
|
print ("----------------------------")
|
||||||
print "List Of VMs"
|
print ("List Of VMs")
|
||||||
print "----------------------------"
|
print ("----------------------------")
|
||||||
for vm in list_of_vms:
|
for vm in list_of_vms:
|
||||||
print ('{}'.format(vm))
|
print ('{}'.format(vm))
|
||||||
print "----------------------------"
|
print ("----------------------------")
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
try:
|
|
||||||
setup()
|
setup()
|
||||||
run()
|
run()
|
||||||
finally:
|
|
||||||
if stub_config:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
Loading…
Reference in New Issue
Block a user