Give layout objects a unique ID

This is a debug aid -- when investigating leaked layout objects,
it would be nice to tie them back to when they were created.

Change-Id: I2b5b3cb33e6891c0cbca15ea82022bfa91ba9048
This commit is contained in:
James E. Blair 2017-10-18 16:58:38 -07:00
parent b0a95abc92
commit 8fe53b4441
2 changed files with 3 additions and 0 deletions

View File

@ -1572,6 +1572,7 @@ class TenantParser(object):
# Don't call this method from dynamic reconfiguration because
# it interacts with drivers and connections.
layout = model.Layout(tenant)
TenantParser.log.debug("Created layout id %s", layout.uuid)
TenantParser._parseLayoutItems(layout, tenant, data,
scheduler, connections)
@ -1700,6 +1701,7 @@ class ConfigLoader(object):
self._loadDynamicProjectData(config, project, files, False, tenant)
layout = model.Layout(tenant)
self.log.debug("Created layout id %s", layout.uuid)
if not include_config_projects:
# NOTE: the actual pipeline objects (complete with queues
# and enqueued items) are copied by reference here. This

View File

@ -2329,6 +2329,7 @@ class Layout(object):
"""Holds all of the Pipelines."""
def __init__(self, tenant):
self.uuid = uuid4().hex
self.tenant = tenant
self.project_configs = {}
self.project_templates = {}