Revision 3ee8033d
b/snf-cyclades-app/synnefo/db/models.py | ||
---|---|---|
504 | 504 |
the BackendNetworks operstate. |
505 | 505 |
|
506 | 506 |
""" |
507 |
|
|
508 |
old_state = self.state |
|
509 |
|
|
507 | 510 |
backend_states = [s.operstate for s in self.backend_networks.all()] |
508 | 511 |
if not backend_states: |
509 | 512 |
self.state = 'PENDING' |
... | ... | |
513 | 516 |
all_equal = len(set(backend_states)) <= 1 |
514 | 517 |
self.state = all_equal and backend_states[0] or 'PENDING' |
515 | 518 |
|
516 |
if self.state == 'DELETED': |
|
519 |
# Release the resources on the deletion of the Network |
|
520 |
if old_state != 'DELETED' and self.state == 'DELETED': |
|
517 | 521 |
self.deleted = True |
518 | 522 |
|
519 | 523 |
if self.mac_prefix: |
Also available in: Unified diff