aboutsummaryrefslogtreecommitdiffstats
path: root/app/discover/events/event_subnet_update.py
diff options
context:
space:
mode:
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(). \