-
Notifications
You must be signed in to change notification settings - Fork 119
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
Only data storage domains in VM transform dialog #229
Conversation
@miq-bot assign tinaafitz |
@miq-bot add_labels gaprindashvili/yes |
@tinaafitz @gmcculloug Can you please review this PR? |
@miq-bot assign gmcculloug |
@@ -21,6 +21,7 @@ def main | |||
values_hash[nil] = 'None' | |||
else | |||
provider.storages.each do |storage| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a #writable_storages
which checks the read_only bit on the host/storage mount. Do non-data storage domains set read-only? Could be a nicer way to skip thse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that #writable_storages
is only available from the Host
model today. That method is already exposed to automate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah you're right for some reason I thought we had that exposed at the provider level, good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smelamud Looks good.
Could you update the spec test:
https://github.com/ManageIQ/manageiq-content/blob/master/spec/content/automate/ManageIQ/Infrastructure/VM/Transform/Import.class/__methods__/list_storages_spec.rb
0e3ef57
to
978caa2
Compare
@tinaafitz Done. |
This pull request is not mergeable. Please rebase and repush. |
978caa2
to
5180959
Compare
Rebased. |
@@ -23,6 +23,7 @@ def main | |||
values_hash[nil] = 'None' | |||
else | |||
provider.storages.each do |storage| | |||
next unless storage.storage_domain_type == "data" | |||
values_hash[storage.id] = storage.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of next unless
this could be a simple if-statement.
values_hash[storage.id] = storage.name if storage.storage_domain_type == "data"
5180959
to
ff0dd47
Compare
@gmcculloug Done. |
@gmcculloug Is it good, may be merged? |
@smelamud I ran the existing list_storages spec test and noticed there weren't any storages included: |
@tinaafitz I see, but still cannot understand how to fix this. Do you have an idea? The provider is created with
When I try to add elements to it, error is thrown. |
4110ae2
to
8af6559
Compare
@tinaafitz Done. |
@tinaafitz ManageIQ/manageiq#16719 which is a prerequisite of this patch has been merged. Please check if it is possible to merge this PR also. |
8af6559
to
e2b3940
Compare
@gmcculloug Done. |
In VM transform dialog allow to select only data storage domains as the destination of VM transformation. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1516706
e2b3940
to
e03ea85
Compare
Fixed failing test. |
Checked commit smelamud@e03ea85 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@tinaafitz Can you review/approve this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gmcculloug Looks good.
Only data storage domains in VM transform dialog (cherry picked from commit 2ece9d3) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1533550
Gaprindashvili backport details:
|
In VM transform dialog allow to select only data storage domains as the
destination of VM transformation.
Depends on ManageIQ/manageiq#16719
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1516706