Skip to content

Commit

Permalink
Collect all tenants during vm targeted refresh
Browse files Browse the repository at this point in the history
To prevent fog-openstack building the wrong query for
.tenants.find_by_id which leads to a 404 error query all tenants during
a targeted refresh.
  • Loading branch information
agrare committed Feb 16, 2018
1 parent efa5865 commit ad512db
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ def tenants

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.respond_to?(:projects) ? identity_service.projects_get_by_id(key) : identity_service.tenants.find_by_id(key) }
end
@tenant_memo ||= identity_service.visible_tenants.index_by(&:id)
@tenant_memo[tenant_id]
end

Expand Down

0 comments on commit ad512db

Please sign in to comment.