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

Fixed cases causing waiting on timeout in vm_import #73

Merged

Conversation

jelkosz
Copy link
Contributor

@jelkosz jelkosz commented Aug 4, 2017

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.

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

@jelkosz jelkosz force-pushed the vm_import_fix_issues_causing_timeouts branch from 1fda1dd to df7eaa8 Compare August 4, 2017 12:13
@jelkosz
Copy link
Contributor Author

jelkosz commented Aug 4, 2017

@miq-bot assign @borod108

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.')
Copy link
Contributor

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')
Copy link
Contributor

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.')
Copy link
Contributor

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

@jelkosz jelkosz force-pushed the vm_import_fix_issues_causing_timeouts branch 2 times, most recently from 0f92f27 to ee7858a Compare August 7, 2017 10:58
@@ -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?
Copy link
Contributor

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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@jelkosz jelkosz force-pushed the vm_import_fix_issues_causing_timeouts branch from ee7858a to ee9690a Compare August 7, 2017 11:56
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.
@jelkosz jelkosz force-pushed the vm_import_fix_issues_causing_timeouts branch from ee9690a to 330a356 Compare August 7, 2017 14:06
@miq-bot
Copy link
Member

miq-bot commented Aug 7, 2017

Checked commit jelkosz@330a356 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
4 files checked, 0 offenses detected
Everything looks fine. 🍰

@oourfali oourfali merged commit f4f79f9 into ManageIQ:master Aug 7, 2017
@jelkosz
Copy link
Contributor Author

jelkosz commented Aug 7, 2017

@miq-bot add_label fine/yes

jelkosz pushed a commit to jelkosz/manageiq-content that referenced this pull request Aug 9, 2017
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
@simaishi
Copy link
Contributor

simaishi commented Aug 9, 2017

@jelkosz this PR is built on top of #61, which isn't marked as fine/yes and backport to Fine branch is conflicting. Can you please create a PR for Fine branch resolving the conflicts?

gmcculloug added a commit to ManageIQ/manageiq-content that referenced this pull request Aug 9, 2017
jelkosz pushed a commit to jelkosz/manageiq that referenced this pull request Aug 10, 2017
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.
jelkosz pushed a commit to jelkosz/manageiq that referenced this pull request Aug 10, 2017
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.
@jelkosz
Copy link
Contributor Author

jelkosz commented Aug 10, 2017

@simaishi backported: ManageIQ/manageiq#15784
Please note the test failure is unrelated and will be fixed by ManageIQ/manageiq#15782

@simaishi
Copy link
Contributor

Backported to Fine via ManageIQ/manageiq#15784

simaishi pushed a commit to ManageIQ/manageiq-content that referenced this pull request Aug 10, 2017
d-m-u pushed a commit to d-m-u/manageiq that referenced this pull request Jun 6, 2018
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.
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.

6 participants