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

v2v: Fix filtering of drivers ISO to display #143

Merged
merged 1 commit into from
Jul 18, 2017
Merged
Show file tree
Hide file tree
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 @@ -21,7 +21,7 @@ def main
values_hash[nil] = '-- no ISO datastore for provider --'
else
values_hash[nil] = '-- select drivers ISO from list --'
provider.iso_datastore.iso_images.pluck(:name).grep(/toolsSetup/).each do |iso|
provider.iso_datastore.iso_images.pluck(:name).grep(/tools.*setup/i).each do |iso|
Copy link
Member

Choose a reason for hiding this comment

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

@matobet Is this condition too loose for the lookup? Where do the iso_image names come from, does we have control over them?

Copy link
Contributor Author

@matobet matobet Jul 18, 2017

Choose a reason for hiding this comment

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

@gmcculloug The iso images come from the RHV iso domain (only RHV providers may be selected in the target infra provider dropdown) and it contains ISOs of given naming convention (among other random ISOs which we don't want to list for this purpose). This convention alas has changed between 3.6 ({RHEV,oVirt}-toolsSetup) and 4.0 (rhev-tools-setup).

We believe that this regex is the right balance between strictness and generality.

values_hash[iso] = iso
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
oVirt-toolsSetup-4.0-1.fc24.iso
oVirt-toolsSetup-4.1-3.fc24.iso
another-random-image.iso
rhev-tools-setup.iso
oVirt-toolsSetup-4.2-4.fc25.iso
).map { |iso| FactoryGirl.create(:iso_image, :name => iso) }
FactoryGirl.create(:iso_datastore, :iso_images => iso_images)
Expand All @@ -47,6 +48,7 @@
oVirt-toolsSetup-4.0-1.fc24.iso
oVirt-toolsSetup-4.1-3.fc24.iso
oVirt-toolsSetup-4.2-4.fc25.iso
rhev-tools-setup.iso
).each { |iso| isos[iso] = iso }

expect(ae_service.object['values']).to eq(isos)
Expand Down