Revision c6afee48 kamaki/clients/cyclades/__init__.py
b/kamaki/clients/cyclades/__init__.py | ||
---|---|---|
399 | 399 |
def wait_network( |
400 | 400 |
self, net_id, |
401 | 401 |
current_status='PENDING', delay=1, max_wait=100, wait_cb=None): |
402 |
"""Wait for network while its status is current_status |
|
403 |
|
|
404 |
:param net_id: integer (str or int) |
|
405 |
|
|
406 |
:param current_status: (str) PENDING | ACTIVE | DELETED |
|
407 | 402 |
|
408 |
:param delay: time interval between retries
|
|
409 |
|
|
410 |
:max_wait: (int) timeout in secconds
|
|
403 |
def get_status(self, net_id):
|
|
404 |
r = self.get_network_details(net_id) |
|
405 |
return r['status'], None
|
|
411 | 406 |
|
412 |
:param wait_cb: if set a progressbar is used to show progress |
|
407 |
return self._wait( |
|
408 |
net_id, current_status, get_status, delay, max_wait, wait_cb) |
|
413 | 409 |
|
414 |
:returns: (str) the new mode if succesfull, (bool) False if timed out |
|
415 |
""" |
|
410 |
def wait_port( |
|
411 |
self, port_id, |
|
412 |
current_status='PENDING', delay=1, max_wait=100, wait_cb=None): |
|
416 | 413 |
|
417 | 414 |
def get_status(self, net_id): |
418 |
r = self.get_network_details(net_id)
|
|
415 |
r = self.get_port_details(port_id)
|
|
419 | 416 |
return r['status'], None |
420 | 417 |
|
421 | 418 |
return self._wait( |
422 |
net_id, current_status, get_status, delay, max_wait, wait_cb) |
|
419 |
port_id, current_status, get_status, delay, max_wait, wait_cb) |
Also available in: Unified diff