Revision 6883dcf3 snf-cyclades-app/synnefo/logic/management/commands/reconcile-networks.py
b/snf-cyclades-app/synnefo/logic/management/commands/reconcile-networks.py | ||
---|---|---|
120 | 120 |
except KeyError: |
121 | 121 |
# Stale network does not exist in backend |
122 | 122 |
if destroying: |
123 |
out.write('D: Stale network %d in backend %s\n' % info) |
|
124 |
if fix: |
|
125 |
out.write("F: Issued OP_NETWORK_REMOVE'\n") |
|
126 |
etime = datetime.datetime.now() |
|
127 |
backend.process_network_status(back_network, etime, |
|
128 |
0, 'OP_NETWORK_REMOVE', 'success', |
|
129 |
'Reconciliation simulated event.') |
|
123 |
if back_network.operstate != "DELETED": |
|
124 |
out.write('D: Stale network %d in backend %s\n' % info) |
|
125 |
if fix: |
|
126 |
out.write("F: Issued OP_NETWORK_REMOVE'\n") |
|
127 |
etime = datetime.datetime.now() |
|
128 |
backend.process_network_status(back_network, etime, |
|
129 |
0, 'OP_NETWORK_REMOVE', 'success', |
|
130 |
'Reconciliation simulated event.') |
|
130 | 131 |
continue |
131 | 132 |
else: |
132 | 133 |
# Pending network |
... | ... | |
182 | 183 |
ip_reserved_maps.append(r_map) |
183 | 184 |
|
184 | 185 |
if uses_pool and (ip_available_maps or ip_reserved_maps): |
185 |
available_map = reduce(lambda x, y: x | y, ip_available_maps)
|
|
186 |
reserved_map = reduce(lambda x, y: x | y, ip_reserved_maps)
|
|
186 |
available_map = reduce(lambda x, y: x & y, ip_available_maps)
|
|
187 |
reserved_map = reduce(lambda x, y: x & y, ip_reserved_maps)
|
|
187 | 188 |
|
188 | 189 |
pool = network.get_pool() |
189 | 190 |
un_available = pool.available != available_map |
Also available in: Unified diff