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 ConversionHost active_tasks method to use state == 'migrate' #18570

Merged
merged 2 commits into from
Mar 19, 2019

Conversation

ghost
Copy link

@ghost ghost commented Mar 19, 2019

When the throttling feature has been moved to the backend, the state for an active task has become migrate, instead of active. This has not been updated in the ConversionHost.active_tasks relationship, which leads to have always zero active tasks reported.

This PR fixes that by changing the state lookup to migrate.

Associated RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1686877

@ghost
Copy link
Author

ghost commented Mar 19, 2019

@miq-bot add_label transformation, bug, hammer/yes, blocker
@miq-bot add_reviewer @djberg96
@miq-bot add_reviewer @agrare

@ghost
Copy link
Author

ghost commented Mar 19, 2019

@miq-bot add_reviewer @jameswnl

@miq-bot miq-bot requested a review from jameswnl March 19, 2019 12:51
@@ -5,7 +5,7 @@ class ConversionHost < ApplicationRecord

belongs_to :resource, :polymorphic => true
has_many :service_template_transformation_plan_tasks, :dependent => :nullify
has_many :active_tasks, -> { where(:state => 'active') }, :class_name => ServiceTemplateTransformationPlanTask, :inverse_of => :conversion_host
has_many :active_tasks, -> { where(:state => 'migrate') }, :class_name => ServiceTemplateTransformationPlanTask, :inverse_of => :conversion_host
Copy link
Contributor

Choose a reason for hiding this comment

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

The paranoia in me thinks we should allow either.

@miq-bot
Copy link
Member

miq-bot commented Mar 19, 2019

Checked commits fabiendupont/manageiq@b734a0d~...693c280 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. 👍

@agrare agrare self-assigned this Mar 19, 2019
@agrare agrare merged commit 693c280 into ManageIQ:master Mar 19, 2019
agrare added a commit that referenced this pull request Mar 19, 2019
…ate_state

[V2V] Fix ConversionHost active_tasks method to use state == 'migrate'
@agrare agrare added this to the Sprint 107 Ending Mar 18, 2019 milestone Mar 19, 2019
simaishi pushed a commit that referenced this pull request Mar 19, 2019
…ate_state

[V2V] Fix ConversionHost active_tasks method to use state == 'migrate'

(cherry picked from commit 7407f63)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1686877
@simaishi
Copy link
Contributor

Hammer backport details:

$ git log -1
commit 4304a7d679db4573a8053e33c57b3d3cde9b683d
Author: Adam Grare <agrare@redhat.com>
Date:   Tue Mar 19 14:44:31 2019 +0100

    Merge pull request #18570 from fdupont-redhat/v2v_throttling_use_migrate_state
    
    [V2V] Fix ConversionHost active_tasks method to use state == 'migrate'
    
    (cherry picked from commit 7407f63a81dca3c7aa67cfeb84dce39da9392d5b)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1686877

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.

5 participants