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

Added Quota calculations for reconfigure resize disks #436

Merged
merged 1 commit into from
Dec 17, 2018

Conversation

billfitzgerald0120
Copy link
Contributor

Added test for disk_resize

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1533263

@miq-bot add_reviewer @tinaafitz
@miq-bot add_label enhancement

@billfitzgerald0120
Copy link
Contributor Author

@tinaafitz Please Review

Copy link
Member

@tinaafitz tinaafitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@billfitzgerald0120 Looks good.
@mkanoor Please review.

@@ -146,6 +146,11 @@ def vmdb_object(model, id)
$evm.vmdb(model, id.to_i) if model && id
end

def get_disk_size(disk_name)
mydisk = $evm.vmdb('disk').find_by(:filename => disk_name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@billfitzgerald0120
Should we log disk_names that are not found and raise an error?
Also add a test case where the disk_name doesn't exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkanoor Made changes as requested.

@billfitzgerald0120
Copy link
Contributor Author

@tinaafitz please review

@@ -146,6 +146,12 @@ def vmdb_object(model, id)
$evm.vmdb(model, id.to_i) if model && id
end

def get_disk_size(disk_name)
mydisk = $evm.vmdb('disk').find_by(:filename => disk_name)
raise "ERROR - Disk_name not found for Reconfiguration" if mydisk.nil?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@billfitzgerald0120 Should we include the disk name when we raise the exception

raise "ERROR - #{disk_name} not found for reconfiguration" if mydisk.nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkanoor Included the disk name when we raise the exception, Please review

Added test for disk_resize

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1533263
Made 2 changes as requested

Added log_and_raise for disk_names that are not found.
Added a test case where the disk_name doesn't exist

Modified error text to be generic
Removed embedded method
Included the disk name when we raise the exception
@miq-bot
Copy link
Member

miq-bot commented Dec 5, 2018

Checked commit billfitzgerald0120@0031d91 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🍪

@mkanoor mkanoor added this to the Sprint 101 Ending Dec 17, 2018 milestone Dec 17, 2018
@mkanoor mkanoor merged commit 366940b into ManageIQ:master Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants