Sleeps till the cleanup configs passed
(apiclient, configs=None)
| 124 | |
| 125 | |
| 126 | def wait_for_cleanup(apiclient, configs=None): |
| 127 | """Sleeps till the cleanup configs passed""" |
| 128 | |
| 129 | # Configs list consists of the list of global configs |
| 130 | if not isinstance(configs, list): |
| 131 | return |
| 132 | for config in configs: |
| 133 | cmd = listConfigurations.listConfigurationsCmd() |
| 134 | cmd.name = config |
| 135 | cmd.listall = True |
| 136 | try: |
| 137 | config_descs = apiclient.listConfigurations(cmd) |
| 138 | except Exception as e: |
| 139 | raise Exception("Failed to fetch configurations: %s" % e) |
| 140 | |
| 141 | if not isinstance(config_descs, list): |
| 142 | raise Exception("List configs didn't returned a valid data") |
| 143 | |
| 144 | config_desc = config_descs[0] |
| 145 | # Sleep for the config_desc.value time |
| 146 | time.sleep(int(config_desc.value)) |
| 147 | return |
| 148 | |
| 149 | |
| 150 | def add_netscaler(apiclient, zoneid, NSservice): |