Make sure to get all tenants by scanning each available domain.
Change-Id: Ieb65cf3d664755eae84e0637607aa78c7f44114c
This commit is contained in:
parent
d3caa24565
commit
ff5822d2b4
@ -12,8 +12,12 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo_log import log
|
||||
|
||||
from ceilometer.agent import plugin_base as plugin
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class TenantDiscovery(plugin.DiscoveryBase):
|
||||
"""Discovery that supplies keystone tenants.
|
||||
@ -24,5 +28,17 @@ class TenantDiscovery(plugin.DiscoveryBase):
|
||||
"""
|
||||
|
||||
def discover(self, manager, param=None):
|
||||
tenants = manager.keystone.projects.list()
|
||||
domains = manager.keystone.domains.list()
|
||||
LOG.debug('Found %s keystone domains', len(domains))
|
||||
if domains:
|
||||
tenants = []
|
||||
for domain in domains:
|
||||
domain_tenants = manager.keystone.projects.list(domain)
|
||||
LOG.debug("Found %s tenants in domain %s", len(domain_tenants),
|
||||
domain.name)
|
||||
tenants = tenants + domain_tenants
|
||||
else:
|
||||
tenants = manager.keystone.projects.list()
|
||||
LOG.debug("No domains - found %s tenants in default domain",
|
||||
len(tenants))
|
||||
return tenants or []
|
||||
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- The tenant (project) discovery code in the polling agent now scans for
|
||||
tenants in all available domains.
|
Loading…
x
Reference in New Issue
Block a user