Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore missing quotas in new graph-based collector #159

Merged
merged 1 commit into from
Nov 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,21 @@ def key_pairs

def quotas
collector.quotas.each do |q|
q.except("id", "tenant_id", "service_name").collect do |key, value|
# Metadata items, injected files, server groups, and rbac policies are not modeled,
# Skip them for now.
q.except("id", "tenant_id", "service_name", "metadata_items", "injected_file_content_bytes",
"injected_files", "injected_file_path_bytes", "server_groups", "server_group_members",
"rbac_policy").collect do |key, value|
begin
value = value.to_i
rescue
value = 0
end
quota = persister.cloud_resource_quotas.find_or_build([q["id"], key])
id = q["id"] || q["tenant_id"]
uid = [id, key]
quota = persister.cloud_resource_quotas.find_or_build(uid)
quota.service_name = q["service_name"]
quota.ems_ref = q["id"]
quota.ems_ref = uid
quota.name = key
quota.value = value
quota.cloud_tenant = persister.cloud_tenants.lazy_find(q["tenant_id"])
Expand Down