aboutsummaryrefslogtreecommitdiffstats
path: root/app/discover/events/event_subnet_update.py
diff options
context:
space:
mode:
authorKoren Lev <korenlev@gmail.com>2017-09-29 01:38:18 +0300
committerKoren Lev <korenlev@gmail.com>2017-09-29 01:38:18 +0300
commitd32f75145676bacefde0d08a14680a5984623451 (patch)
tree4b5eaf1107e6973b1eac636309a99c83074acbfc /app/discover/events/event_subnet_update.py
parent0c5426cd309d720db1e30641e43d311ee0b751b0 (diff)
release 1.0 calipso for opnfv apex
Change-Id: I3e63cd27c5f4d3756e67a07c749863a68e84dde2 Signed-off-by: Koren Lev <korenlev@gmail.com>
Diffstat (limited to 'app/discover/events/event_subnet_update.py')
-rw-r--r--app/discover/events/event_subnet_update.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/discover/events/event_subnet_update.py b/app/discover/events/event_subnet_update.py
index 3529f0d..59b0afb 100644
--- a/app/discover/events/event_subnet_update.py
+++ b/app/discover/events/event_subnet_update.py
@@ -23,6 +23,7 @@ class EventSubnetUpdate(EventBase):
def handle(self, env, notification):
# check for network document.
subnet = notification['payload']['subnet']
+ project_id = notification['_context_project_id']
project = notification['_context_project_name']
host_id = notification['publisher_id'].replace('network.', '', 1)
subnet_id = subnet['id']
@@ -47,10 +48,10 @@ class EventSubnetUpdate(EventBase):
network_document['name'])
# make sure that self.regions is not empty.
- if len(ApiAccess.regions) == 0:
+ if not ApiAccess.regions:
fetcher = ApiFetchRegions()
fetcher.set_env(env)
- fetcher.get(None)
+ fetcher.get(project_id)
self.log.info("add port binding to DHCP server.")
port_id = DbFetchPort(). \