From 3a3ec038347184a4b5cefd4f4c51f2d39f52289c Mon Sep 17 00:00:00 2001 From: pgbidkar Date: Wed, 22 Feb 2017 14:05:01 +0530 Subject: [PATCH] Fixed indentation space and Tab format issues --- samples/vsphere/vcenter/vm/list_vms.py | 43 ++++++++++++-------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/samples/vsphere/vcenter/vm/list_vms.py b/samples/vsphere/vcenter/vm/list_vms.py index 7d912342..4d79de26 100644 --- a/samples/vsphere/vcenter/vm/list_vms.py +++ b/samples/vsphere/vcenter/vm/list_vms.py @@ -27,34 +27,31 @@ vCenter/ESX stub_config = None cleardata = False + def setup(context=None): - global stub_config, cleardata - server, username, password, cleardata, skip_verification = \ - parse_cli_args() - stub_config = vapiconnect.connect(server, - username, - password, - skip_verification) - atexit.register(vapiconnect.logout, stub_config) + global stub_config, cleardata + server, username, password, cleardata, skip_verification = parse_cli_args() + stub_config = vapiconnect.connect(server, username, password, skip_verification) + atexit.register(vapiconnect.logout, stub_config) def run(): - """ - List VMs present in server - """ - vm_svc = VM(stub_config) - list_of_vms = vm_svc.list() - print ("----------------------------") - print ("List Of VMs") - print ("----------------------------") - for vm in list_of_vms: - print ('{}'.format(vm)) - print ("----------------------------") - + """ + List VMs present in server + """ + vm_svc = VM(stub_config) + list_of_vms = vm_svc.list() + print ("----------------------------") + print ("List Of VMs") + print ("----------------------------") + for vm in list_of_vms: + print ('{}'.format(vm)) + print ("----------------------------") + def main(): - setup() - run() + setup() + run() if __name__ == '__main__': - main() \ No newline at end of file + main()