aboutsummaryrefslogtreecommitdiffstats
path: root/app/discover/events/event_subnet_update.py
diff options
context:
space:
mode:
authorYaron Yogev <yaronyogev@gmail.com>2017-08-28 07:06:52 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-08-28 07:06:52 +0000
commit834c0f5899a7823ce77453aae4add76245b794c6 (patch)
tree993acfaa6f2010e74ea6a3f73495714e1c8b917f /app/discover/events/event_subnet_update.py
parent23f0c36a014295988d5fcbf9f0bda0ae2cb54057 (diff)
parent2f9d5cf583b4b5dd635f386cb9ac07435bd44cc8 (diff)
Merge "Heavily refactored all event based scans"
Diffstat (limited to 'app/discover/events/event_subnet_update.py')
-rw-r--r--app/discover/events/event_subnet_update.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/discover/events/event_subnet_update.py b/app/discover/events/event_subnet_update.py
index 9d3c48b..26d1984 100644
--- a/app/discover/events/event_subnet_update.py
+++ b/app/discover/events/event_subnet_update.py
@@ -93,10 +93,14 @@ class EventSubnetUpdate(EventBase):
if subnet['name'] == subnets[key]['name']:
subnets[key] = subnet
else:
- # TODO: #AskCheng shouldn't we remove the old one?
+ del subnets[key]
subnets[subnet['name']] = subnet
self.inv.set(network_document)
return EventResult(result=True,
related_object=subnet['id'],
display_context=network_id)
+ else:
+ self.log.info(
+ 'subnet not in network, aborting subnet update')
+ return EventResult(result=False, retry=False) \ No newline at end of file