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

fix condition for calculate quotas for reserved networks #3573

Open
wants to merge 1 commit into
base: master
from

Conversation

@telecast-git
Copy link

commented Aug 6, 2019

It’s seems additional quotas on not exist resourses is working from this condition:

fsck/quotas.rb

475                 parent_id = ar.xpath('AR/PARENT_NETWORK_AR_ID')
476                 parent_id = parent_id.text unless parent_id.nil?
477 
478                 next if parent_id.nil? || parent_id.empty?
479 
480                 vnet_usage[parent_id] = 0 if vnet_usage[parent_id].nil?
481 
482                 ar.xpath('AR/SIZE').each do |size|
483                     vnet_usage[parent_id] += size.text.to_i

In this case if “PARENT_NETWORK_AR_ID” not exist we will be add VALUE to empty KEY, i.e. instead PARENT_NETWORK_AR_ID = [SIZE] we have __ = [SIZE].
May be will more logical if this will so:

478 next if !parent_id.nil? || !parent_id.empty?

If we meet empty or nil KEY PARENT_NETWORK_AR_ID, will missed it and won’t added additional quotas on not exist resources.

Alexandr Baranov
fix condition for calculate quotas for reserved networks
Signed-off-by: Alexandr Baranov <baranov@jinr.ru>

@telecast-git telecast-git force-pushed the telecast-git:master branch from 69ca4ee to 0e0dcff Aug 6, 2019

@GitCop

This comment has been minimized.

Copy link

commented on 0e0dcff Aug 6, 2019

There were the following issues with your Pull Request

  • Subject needs to conform to "%{type} #%{issue_number}: %{description}"
  • Subject must be equal or less than 50

Guidelines are available at https://github.com/OpenNebula/one/blob/master/share/doc/dev/COMMIT_MESSAGES.md


This message was auto-generated by https://gitcop.com

@al3xhh al3xhh self-requested a review Aug 6, 2019

@al3xhh al3xhh self-assigned this Aug 6, 2019

@screenlock

This comment has been minimized.

Copy link

commented Aug 19, 2019

possible duplicate request #3405

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.