From 46ab4ce34951b72a4c2397a8801206a2ce537f59 Mon Sep 17 00:00:00 2001 From: pgbidkar Date: Fri, 10 Mar 2017 14:45:20 +0530 Subject: [PATCH] Adding ESXPASSWORD as commandline argument. ESXPassword cannot be hardcoded in testbed.py file since ESX doesnt have default password Signed-off-by: Pavan Bidkar Adding ESXPASSWORD as commandline argument. ESXPassword cannot be hardcoded in testbed.py file since ESX doesnt have default password Signed-off-by: Pavan Bidkar --- samples/vsphere/vcenter/setup/main.py | 3 +++ samples/vsphere/vcenter/setup/setup_cli.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/samples/vsphere/vcenter/setup/main.py b/samples/vsphere/vcenter/setup/main.py index fb066f15..c5fc110d 100644 --- a/samples/vsphere/vcenter/setup/main.py +++ b/samples/vsphere/vcenter/setup/main.py @@ -49,9 +49,12 @@ if (args.esxhost1): _testbed.config['ESX_HOST1'] = args.esxhost1 if (args.esxhost2): _testbed.config['ESX_HOST2'] = args.esxhost2 +if (args.esxpassword): + _testbed.config['ESX_PASS'] = args.esxpassword if (args.nfsserver): _testbed.config['NFS_HOST'] = args.nfsserver + print(_testbed.to_config_string()) # Connect to VIM API Endpoint on vCenter system diff --git a/samples/vsphere/vcenter/setup/setup_cli.py b/samples/vsphere/vcenter/setup/setup_cli.py index 5b0a86fe..7b04d332 100644 --- a/samples/vsphere/vcenter/setup/setup_cli.py +++ b/samples/vsphere/vcenter/setup/setup_cli.py @@ -39,6 +39,7 @@ def build_arg_parser(): -server, --vcenterserver -e1, --esxhost1 -e2, --esxhost2 + -epass, --esxpassword -n, --nfsserver """ @@ -100,6 +101,11 @@ def build_arg_parser(): help='ESX HOST 2 IP to prepare the testbed to run the samples.' 'If not passed as argument, update testbed.py file') + parser.add_argument('-epass', '--esxpassword', + action='store', + help='ESX Server password' + 'If not passed as argument, update testbed.py file') + parser.add_argument('-n', '--nfsserver', action='store', help='NFS Server IP to setup datastore for samples run.'