diff options
Diffstat (limited to 'func')
-rw-r--r-- | func/cli.py | 6 | ||||
-rw-r--r-- | func/env_setup.py | 12 | ||||
-rw-r--r-- | func/spawn_vm.py | 1 |
3 files changed, 11 insertions, 8 deletions
diff --git a/func/cli.py b/func/cli.py index 5e8f02cf..4613b507 100644 --- a/func/cli.py +++ b/func/cli.py @@ -54,13 +54,15 @@ class cli: @staticmethod def _parse_args(args): parser = argparse.ArgumentParser() - parser.add_argument('-l ', '--lab', help='Name of Lab on which being tested, These can' + parser.add_argument('-l ', '--lab', required=True, help='Name of Lab ' + 'on which being tested, These can' 'be found in the test_cases/ directory. Please ' 'ensure that you have edited the respective files ' 'before using them. For testing other than through Jenkins' ' The user should list default after -l . all the fields in' ' the files are necessary and should be filled') - parser.add_argument('-f', '--file', help='File in test_list with the list of tests. there are three files' + parser.add_argument('-f', '--file', required=True, help='File in ' + 'test_list with the list of tests. there are three files' '\n compute ' '\n storage ' '\n network ' diff --git a/func/env_setup.py b/func/env_setup.py index 9c0dadb3..f59883a0 100644 --- a/func/env_setup.py +++ b/func/env_setup.py @@ -98,16 +98,18 @@ class Env_setup: print 'Retrying SSH %s' % infinity @staticmethod - def ping_test(lister): - + def ping_test(lister, attempts=30): for k, v in lister.iteritems(): time.sleep(10) for val in v: ipvar = val ping_cmd = 'ping -D -c1 {0}'.format(ipvar) - while os.system(ping_cmd) != 0: - print '\nWaiting for machine\n' - time.sleep(10) + for i in range(attempts): + if os.system(ping_cmd) != 0: + print '\nWaiting for machine\n' + time.sleep(10) + else: + break print ('\n\n %s is UP \n\n ' % ipvar) def get_host_machine_info(self, host_tag): diff --git a/func/spawn_vm.py b/func/spawn_vm.py index ec63230c..15c26861 100644 --- a/func/spawn_vm.py +++ b/func/spawn_vm.py @@ -26,7 +26,6 @@ class SpawnVM(Env_setup): installer = ''
def __init__(self, vm_info):
- Env_setup.__init__(self)
print 'SpawnVM Class initiated'
vm_role_ip_dict = vm_info.copy()
print 'Generating Heat Template\n'
|