Created
January 18, 2018 13:38
-
-
Save aufi/0aa539a6af36cba147f2830fa3ead598 to your computer and use it in GitHub Desktop.
[NoMethodError]: undefined method `tenants' for #<OpenstackHandle::IdentityDelegate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/models/manageiq/providers/openstack/inventory/collector/target_collection.rb b/app/models/manageiq/providers/openstack/inventory/collector/target_collection.rb | |
index d7123942..61274aad 100644 | |
--- a/app/models/manageiq/providers/openstack/inventory/collector/target_collection.rb | |
+++ b/app/models/manageiq/providers/openstack/inventory/collector/target_collection.rb | |
@@ -124,7 +124,7 @@ class ManageIQ::Providers::Openstack::Inventory::Collector::TargetCollection < M | |
def memoized_get_tenant(tenant_id) | |
return nil if tenant_id.blank? | |
@tenant_memo ||= Hash.new do |h, key| | |
- h[key] = safe_get { identity_service.tenants.find_by_id(key) } | |
+ h[key] = safe_get { identity_service.respond_to?(:tenants) ? identity_service.tenants.find_by_id(key) : identity_service.projects.find_by_id(key) } | |
end | |
@tenant_memo[tenant_id] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment