Revision 0b3a4894 snf-tools/synnefo_tools/burnin.py
b/snf-tools/synnefo_tools/burnin.py | ||
---|---|---|
116 | 116 |
def _get_user_id(): |
117 | 117 |
"""Authenticate to astakos and get unique users id""" |
118 | 118 |
astakos = AstakosClient(AUTH_URL, TOKEN) |
119 |
astakos.CONNECTION_RETRY_LIMIT = 2 |
|
119 | 120 |
authenticate = astakos.authenticate() |
120 | 121 |
return authenticate['access']['user']['id'] |
121 | 122 |
|
... | ... | |
208 | 209 |
@classmethod |
209 | 210 |
def setUpClass(cls): |
210 | 211 |
cls.astakos = AstakosClient(AUTH_URL, TOKEN) |
212 |
cls.astakos.CONNECTION_RETRY_LIMIT = 2 |
|
211 | 213 |
cls.compute_url = \ |
212 | 214 |
cls.astakos.get_service_endpoints('compute')['publicURL'] |
213 | 215 |
cls.result_dict = dict() |
... | ... | |
217 | 219 |
log.info("Authentication test") |
218 | 220 |
falseToken = '12345' |
219 | 221 |
c = ComputeClient(self.compute_url, falseToken) |
222 |
c.CONNECTION_RETRY_LIMIT = 2 |
|
220 | 223 |
|
221 | 224 |
with self.assertRaises(ClientError) as cm: |
222 | 225 |
c.list_servers() |
... | ... | |
232 | 235 |
"""Initialize kamaki, get (detailed) list of images""" |
233 | 236 |
log.info("Getting simple and detailed list of images") |
234 | 237 |
cls.astakos_client = AstakosClient(AUTH_URL, TOKEN) |
238 |
cls.astakos_client.CONNECTION_RETRY_LIMIT = 2 |
|
235 | 239 |
# Compute Client |
236 | 240 |
compute_url = \ |
237 | 241 |
cls.astakos_client.get_service_endpoints('compute')['publicURL'] |
238 | 242 |
cls.compute_client = ComputeClient(compute_url, TOKEN) |
243 |
cls.compute_client.CONNECTION_RETRY_LIMIT = 2 |
|
239 | 244 |
# Image Client |
240 | 245 |
image_url = \ |
241 | 246 |
cls.astakos_client.get_service_endpoints('image')['publicURL'] |
242 | 247 |
cls.image_client = ImageClient(image_url, TOKEN) |
248 |
cls.image_client.CONNECTION_RETRY_LIMIT = 2 |
|
243 | 249 |
# Pithos Client |
244 | 250 |
pithos_url = cls.astakos_client.\ |
245 | 251 |
get_service_endpoints('object-store')['publicURL'] |
... | ... | |
365 | 371 |
"""Initialize kamaki, get (detailed) list of flavors""" |
366 | 372 |
log.info("Getting simple and detailed list of flavors") |
367 | 373 |
cls.astakos_client = AstakosClient(AUTH_URL, TOKEN) |
374 |
cls.astakos_client.CONNECTION_RETRY_LIMIT = 2 |
|
368 | 375 |
# Compute Client |
369 | 376 |
compute_url = \ |
370 | 377 |
cls.astakos_client.get_service_endpoints('compute')['publicURL'] |
371 | 378 |
cls.compute_client = ComputeClient(compute_url, TOKEN) |
379 |
cls.compute_client.CONNECTION_RETRY_LIMIT = 2 |
|
372 | 380 |
cls.flavors = cls.compute_client.list_flavors() |
373 | 381 |
cls.dflavors = cls.compute_client.list_flavors(detail=True) |
374 | 382 |
cls.result_dict = dict() |
... | ... | |
413 | 421 |
log.info("Getting simple and detailed list of servers") |
414 | 422 |
|
415 | 423 |
cls.astakos_client = AstakosClient(AUTH_URL, TOKEN) |
424 |
cls.astakos_client.CONNECTION_RETRY_LIMIT = 2 |
|
416 | 425 |
# Compute Client |
417 | 426 |
compute_url = \ |
418 | 427 |
cls.astakos_client.get_service_endpoints('compute')['publicURL'] |
419 | 428 |
cls.compute_client = ComputeClient(compute_url, TOKEN) |
429 |
cls.compute_client.CONNECTION_RETRY_LIMIT = 2 |
|
420 | 430 |
cls.servers = cls.compute_client.list_servers() |
421 | 431 |
cls.dservers = cls.compute_client.list_servers(detail=True) |
422 | 432 |
cls.result_dict = dict() |
... | ... | |
449 | 459 |
log.info("Getting list of containers") |
450 | 460 |
|
451 | 461 |
cls.astakos_client = AstakosClient(AUTH_URL, TOKEN) |
462 |
cls.astakos_client.CONNECTION_RETRY_LIMIT = 2 |
|
452 | 463 |
# Pithos Client |
453 | 464 |
pithos_url = cls.astakos_client.\ |
454 | 465 |
get_service_endpoints('object-store')['publicURL'] |
... | ... | |
530 | 541 |
log.info("Spawning server for image `%s'" % cls.imagename) |
531 | 542 |
|
532 | 543 |
cls.astakos_client = AstakosClient(AUTH_URL, TOKEN) |
544 |
cls.astakos_client.CONNECTION_RETRY_LIMIT = 2 |
|
533 | 545 |
# Cyclades Client |
534 | 546 |
compute_url = \ |
535 | 547 |
cls.astakos_client.get_service_endpoints('compute')['publicURL'] |
536 | 548 |
cls.cyclades_client = CycladesClient(compute_url, TOKEN) |
549 |
cls.cyclades_client.CONNECTION_RETRY_LIMIT = 2 |
|
537 | 550 |
|
538 | 551 |
cls.result_dict = dict() |
539 | 552 |
|
... | ... | |
1011 | 1024 |
"Initialize kamaki, get list of current networks" |
1012 | 1025 |
|
1013 | 1026 |
cls.astakos_client = AstakosClient(AUTH_URL, TOKEN) |
1027 |
cls.astakos_client.CONNECTION_RETRY_LIMIT = 2 |
|
1014 | 1028 |
# Cyclades Client |
1015 | 1029 |
compute_url = \ |
1016 | 1030 |
cls.astakos_client.get_service_endpoints('compute')['publicURL'] |
1017 | 1031 |
cls.cyclades_client = CycladesClient(compute_url, TOKEN) |
1032 |
cls.cyclades_client.CONNECTION_RETRY_LIMIT = 2 |
|
1018 | 1033 |
|
1019 | 1034 |
cls.servername = "%s%s for %s" % (SNF_TEST_PREFIX, |
1020 | 1035 |
TEST_RUN_ID, |
... | ... | |
1821 | 1836 |
def cleanup_servers(timeout, query_interval, delete_stale=False): |
1822 | 1837 |
|
1823 | 1838 |
astakos_client = AstakosClient(AUTH_URL, TOKEN) |
1839 |
astakos_client.CONNECTION_RETRY_LIMIT = 2 |
|
1824 | 1840 |
# Compute Client |
1825 | 1841 |
compute_url = astakos_client.get_service_endpoints('compute')['publicURL'] |
1826 | 1842 |
compute_client = ComputeClient(compute_url, TOKEN) |
1843 |
compute_client.CONNECTION_RETRY_LIMIT = 2 |
|
1827 | 1844 |
|
1828 | 1845 |
servers = compute_client.list_servers() |
1829 | 1846 |
stale = [s for s in servers if s["name"].startswith(SNF_TEST_PREFIX)] |
... | ... | |
1866 | 1883 |
def cleanup_networks(action_timeout, query_interval, delete_stale=False): |
1867 | 1884 |
|
1868 | 1885 |
astakos_client = AstakosClient(AUTH_URL, TOKEN) |
1886 |
astakos_client.CONNECTION_RETRY_LIMIT = 2 |
|
1869 | 1887 |
# Cyclades Client |
1870 | 1888 |
compute_url = astakos_client.get_service_endpoints('compute')['publicURL'] |
1871 | 1889 |
cyclades_client = CycladesClient(compute_url, TOKEN) |
1890 |
cyclades_client.CONNECTION_RETRY_LIMIT = 2 |
|
1872 | 1891 |
|
1873 | 1892 |
networks = cyclades_client.list_networks() |
1874 | 1893 |
stale = [n for n in networks if n["name"].startswith(SNF_TEST_PREFIX)] |
... | ... | |
2110 | 2129 |
|
2111 | 2130 |
# Initialize a kamaki instance, get flavors, images |
2112 | 2131 |
astakos_client = AstakosClient(AUTH_URL, TOKEN) |
2132 |
astakos_client.CONNECTION_RETRY_LIMIT = 2 |
|
2113 | 2133 |
# Compute Client |
2114 | 2134 |
compute_url = astakos_client.get_service_endpoints('compute')['publicURL'] |
2115 | 2135 |
compute_client = ComputeClient(compute_url, TOKEN) |
2136 |
compute_client.CONNECTION_RETRY_LIMIT = 2 |
|
2116 | 2137 |
DIMAGES = compute_client.list_images(detail=True) |
2117 | 2138 |
DFLAVORS = compute_client.list_flavors(detail=True) |
2118 | 2139 |
|
Also available in: Unified diff