Project

General

Profile

Bug #21472

foreman-tasks-delete always failed showing Invalid State

Added by Swapnil Abnave about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1506237

Description of problem: We were trying foreman-tasks-delete from foreman-maintain advanced procedure run with --state as pending/paused/running/stopped. But it always display Invalid state error.

Version-Release number of selected component (if applicable): foreman-maintain snap 3

  1. rpm -q rubygem-foreman_maintain
    rubygem-foreman_maintain-0.0.10-1.el7sat.noarch

How reproducible: always

Steps to Reproduce:
1.# foreman-maintain advanced procedure run foreman-tasks-delete --state paused
Running ForemanMaintain::Scenario ================================================================================
Delete tasks:
/ Deleting paused task [FAIL]
Invalid State
--------------------------------------------------------------------------------
Scenario [ForemanMaintain::Scenario] failed.

The following steps ended up in failing state:

[foreman-tasks-delete]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist="foreman-tasks-delete"

Actual results:
FAIL showing Invalid State and Runtime error in foreman-maintain.log

I, [2017-10-25 09:16:32-0400 #24695] INFO -- : Running foreman-maintain command with arguments "advanced", "procedure", "run", "foreman-tasks-delete", "--state", "paused"
E, [2017-10-25 09:16:32-0400 #24695] ERROR -- : Invalid State (RuntimeError)
/usr/share/gems/gems/foreman_maintain-0.0.10/definitions/features/foreman_tasks.rb:87:in `condition'
/usr/share/gems/gems/foreman_maintain-0.0.10/definitions/features/foreman_tasks.rb:67:in `count'
/usr/share/gems/gems/foreman_maintain-0.0.10/definitions/procedures/foreman_tasks/delete.rb:10:in `block in run'
/usr/share/gems/gems/foreman_maintain-0.0.10/lib/foreman_maintain/reporter/cli_reporter.rb:135:in `with_spinner'
/usr/share/gems/gems/foreman_maintain-0.0.10/definitions/procedures/foreman_tasks/delete.rb:9:in `run'
/usr/share/gems/gems/foreman_maintain-0.0.10/lib/foreman_maintain/executable.rb:118:in `__run__'
/usr/share/gems/gems/foreman_maintain-0.0.10/lib/foreman_maintain/runner/execution.rb:76:in `block (2 levels) in run'
/usr/share/gems/gems/foreman_maintain-0.0.10/lib/foreman_maintain/runner/execution.rb:99:in `capture_errors'
/usr/share/gems/gems/foreman_maintain-0.0.10/lib/foreman_maintain/runner/execution.rb:75:in `block in run'
/usr/share/gems/gems/foreman_maintain-0.0.10/lib/foreman_maintain/runner/execution.rb:93:in `with_metadata_calculation'
/usr/share/gems/gems/foreman_maintain-0.0.10/lib/foreman_maintain/runner/execution.rb:74:in `run'
/usr/share/gems/gems/foreman_maintain-0.0.10/lib/foreman_maintain/runner.rb:108:in `run_step'
/usr/share/gems/gems/foreman_maintain-0.0.10/lib/foreman_maintain/runner.rb:97:in `run_steps'
/usr/share/gems/gems/foreman_maintain-0.0.10/lib/foreman_maintain/runner.rb:90:in `execute_scenario_steps'
/usr/share/gems/gems/foreman_maintain-0.0.10/lib/foreman_maintain/runner.rb:45:in `run_scenario'
/usr/share/gems/gems/foreman_maintain-0.0.10/lib/foreman_maintain/runner.rb:30:in `block in run'
/usr/share/gems/gems/foreman_maintain-0.0.10/lib/foreman_maintain/runner.rb:29:in `each'
/usr/share/gems/gems/foreman_maintain-0.0.10/lib/foreman_maintain/runner.rb:29:in `run'
/usr/share/gems/gems/foreman_maintain-0.0.10/lib/foreman_maintain/cli/base.rb:48:in `run_scenario'
/usr/share/gems/gems/foreman_maintain-0.0.10/lib/foreman_maintain/cli/advanced/procedure/abstract_procedure_command.rb:12:in `execute'
/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
/usr/share/gems/gems/foreman_maintain-0.0.10/lib/foreman_maintain/cli.rb:21:in `run'
/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
/usr/share/gems/gems/foreman_maintain-0.0.10/bin/foreman-maintain:12:in `<top (required)>'
/usr/bin/foreman-maintain:23:in `load'
/usr/bin/foreman-maintain:23:in `<main>'

Expected results:

Additional info:

Associated revisions

Revision e9e51107 (diff)
Added by Swapnil Abnave about 3 years ago

Fixes #21472 - task-delete validate state with string comparison

History

#1 Updated by The Foreman Bot about 3 years ago

  • Pull request https://github.com/theforeman/foreman_maintain/pull/118 added

#2 Updated by Swapnil Abnave about 3 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

Also available in: Atom PDF