Skip to content

Commit

Permalink
Feature OpenNebula#1490: Fix bug in VM_QUOTA element
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosms committed Oct 22, 2012
1 parent 77f7613 commit 25e73de
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/onedb/3.8.0_fsck.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,8 @@ def calculate_quotas(doc, where_filter, resource)
doc.root.each_element("VM_QUOTA/VM") { |e| vm_elem = e }

if vm_elem.nil?
doc.root.delete_element("VM_QUOTA")

vm_quota = doc.root.add_element("VM_QUOTA")
vm_elem = vm_quota.add_element("VM")

Expand Down Expand Up @@ -1096,6 +1098,11 @@ def calculate_quotas(doc, where_filter, resource)
end
}

if ( cpu_used == 0.0 && mem_used == 0 && vms_used == 0 )
doc.root.delete_element("VM_QUOTA")
doc.root.add_element("VM_QUOTA")
end


# VNet quotas

Expand Down

0 comments on commit 25e73de

Please sign in to comment.