Revision d7ff7f5a snf-cyclades-app/synnefo/logic/backend.py
b/snf-cyclades-app/synnefo/logic/backend.py | ||
---|---|---|
55 | 55 |
|
56 | 56 |
_reverse_tags = dict((v.split(':')[3], k) for k, v in _firewall_tags.items()) |
57 | 57 |
|
58 |
# Timeout in seconds for building NICs. After this period the NICs considered |
|
59 |
# stale and removed from DB. |
|
60 |
BUILDING_NIC_TIMEOUT = 180 |
|
58 | 61 |
|
59 | 62 |
NIC_FIELDS = ["state", "mac", "ipv4", "ipv6", "network", "firewall_profile"] |
60 | 63 |
|
... | ... | |
241 | 244 |
# TODO: This is dangerous as the job may be stack in the queue, and |
242 | 245 |
# releasing the IP may lead to duplicate IP use. |
243 | 246 |
if nic.state != "BUILDING" or (nic.state == "BUILDING" and |
244 |
etime > nic.created + timedelta(minutes=5)):
|
|
247 |
etime > nic.created + timedelta(seconds=BUILDING_NIC_TIMEOUT)):
|
|
245 | 248 |
release_nic_address(nic) |
246 | 249 |
nic.delete() |
247 | 250 |
else: |
Also available in: Unified diff