-
Notifications
You must be signed in to change notification settings - Fork 62
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
Fixed cases causing waiting on timeout in vm_import #73
Fixed cases causing waiting on timeout in vm_import #73
Conversation
1fda1dd
to
df7eaa8
Compare
def submit_import_vm(userid, source_vm_id, target_params) | ||
task_id = queue_self_method_call(userid, 'Import VM', 'import_vm', source_vm_id, target_params) | ||
task = MiqTask.wait_for_taskid(task_id) | ||
|
||
check_task!(task, 'Error while importing the VM.') |
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.
Shouldn't 'Error while importing the VM.'
be replaced with _('Error while importing the VM.')
instead of _(msg)
in line 49 ?
task.task_results | ||
end | ||
|
||
def validate_import_vm | ||
Gem::Version.new(api_version) >= Gem::Version.new('4') | ||
# The version of the RHV needs to be at least 4.1.5 due to https://bugzilla.redhat.com/1477375 | ||
!api_version.nil? && Gem::Version.new(api_version.split('_').first) >= Gem::Version.new('4.1.5') |
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.
Could it be that api_version.nil
have a nill value ?
Please use version_higher_than?
from infra_manager for comparing versions.
end | ||
|
||
def submit_configure_imported_vm_networks(userid, vm_id) | ||
task_id = queue_self_method_call(userid, "Configure imported VM's networks", 'configure_imported_vm_networks', vm_id) | ||
task = MiqTask.wait_for_taskid(task_id) | ||
|
||
check_task!(task, 'Error while configuring VM network.') |
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.
same comment regarding message localization
0f92f27
to
ee7858a
Compare
@@ -148,7 +148,9 @@ def supports_migrate_for_all?(vms) | |||
end | |||
|
|||
def version_higher_than?(version) | |||
ems_version = api_version[/\d+\.\d+/x] | |||
return false if api_version.nil? |
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.
Could you add a test to manageiq-providers-ovirt/spec/models/manageiq/providers/redhat/infra_manager_spec.rb
#context "#version_higher_than?" do
for a nil value ?
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.
done
ee7858a
to
ee9690a
Compare
2 problems fixed: - allow to import only using 4.1.5+ provider. The reason is that the required fix (https://bugzilla.redhat.com/1477375) is present in 4.1.5+ and without this fix manageiq will wait until timeout reached. - check if submit to the provider succeeded. The reason is that if the result is not checked, this state will always succeed and the import will again wait until timeout.
ee9690a
to
330a356
Compare
Checked commit jelkosz@330a356 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@miq-bot add_label fine/yes |
The tests have been broken by ManageIQ/manageiq-providers-ovirt#73 because the requirement for a api version have been strenghtened from 4.1+ to 4.1.5+. Fixes: ManageIQ#165
fixed failing tests due to ManageIQ/manageiq-providers-ovirt#73
This is a backport of ManageIQ/manageiq-providers-ovirt/pull/73/ It tries to be a minimal backport needed but still includes all the relevant tests. 2 problems fixed: - allow to import only using 4.1.5+ provider. The reason is that the required fix (https://bugzilla.redhat.com/1477375) is present in 4.1.5+ and without this fix manageiq will wait until timeout reached. - check if submit to the provider succeeded. The reason is that if the result is not checked, this state will always succeed and the import will again wait until timeout.
This is a backport of ManageIQ/manageiq-providers-ovirt/pull/73/ It tries to be a minimal backport needed but still includes all the relevant tests. 2 problems fixed: - allow to import only using 4.1.5+ provider. The reason is that the required fix (https://bugzilla.redhat.com/1477375) is present in 4.1.5+ and without this fix manageiq will wait until timeout reached. - check if submit to the provider succeeded. The reason is that if the result is not checked, this state will always succeed and the import will again wait until timeout.
@simaishi backported: ManageIQ/manageiq#15784 |
Backported to Fine via ManageIQ/manageiq#15784 |
fixed failing tests due to ManageIQ/manageiq-providers-ovirt#73 (cherry picked from commit 6e7535b) https://bugzilla.redhat.com/show_bug.cgi?id=1479414
This is a backport of ManageIQ/manageiq-providers-ovirt/pull/73/ It tries to be a minimal backport needed but still includes all the relevant tests. 2 problems fixed: - allow to import only using 4.1.5+ provider. The reason is that the required fix (https://bugzilla.redhat.com/1477375) is present in 4.1.5+ and without this fix manageiq will wait until timeout reached. - check if submit to the provider succeeded. The reason is that if the result is not checked, this state will always succeed and the import will again wait until timeout.
2 problems fixed:
The reason is that the required fix (https://bugzilla.redhat.com/1477375) is
present in 4.1.5+ and without this fix manageiq will wait until timeout
reached.
The reason is that if the result is not checked, this state will always
succeed and the import will again wait until timeout.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1473169