Bug 1728243 - API to cancel Remote Execution tasks before their scheduled time doesn't work with org/loc scope
Summary: API to cancel Remote Execution tasks before their scheduled time doesn't work...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Remote Execution
Version: 6.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.6.0
Assignee: Adam Ruzicka
QA Contact: Peter Dragun
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-09 12:09 UTC by Lucie Vrtelova
Modified: 2019-10-22 19:48 UTC (History)
3 users (show)

Fixed In Version: tfm-rubygem-foreman_remote_execution-1.8.0.3-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-22 19:48:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 27573 0 Normal Closed API to cancel Remote Execution tasks before their scheduled time doesn't work with org/loc scope 2021-02-03 13:30:48 UTC

Description Lucie Vrtelova 2019-07-09 12:09:42 UTC
Description of problem:
Canceling REX tasks doesn't work with organization/ location scope even though help string say so.

Version-Release number of selected component (if applicable):
rubygem-foreman_maintain-0.4.4-1.el7sat.noarch

How reproducible:
always

Steps to Reproduce:
1. Schedule a future task on a remote host using org/loc tag
2. Determines task should not be executed and would like to remove it using org/loc tag.

Actual results:
Job can't be canceled.

Expected results:
Job is canceled. Or loc/org tag is removed from possible options.

Additional info:
# hammer job-invocation cancel --help
Usage:
    hammer job-invocation cancel [OPTIONS]

Options:
 --force FORCE                     One of true/false, yes/no, 1/0.
 --id ID                            
 --location-id LOCATION_ID         Scope by locations
 --organization-id ORGANIZATION_ID Scope by organizations
 -h, --help                        Print help

# hammer -v job-invocation create --start-at "$(date --utc +'%Y-%m-%d %H:%M:%S' -d 'now +5 min')" --job-template "Run Command - SSH Default" --search-query "name = helpful-snipe.lxd" --inputs command="ls -la /" --organization-id 1
Job invocation 14 created

# hammer job-invocation list
---|--------------------------------|-----------|---------|--------|---------|-------|------------------------
ID | DESCRIPTION                    | STATUS    | SUCCESS | FAILED | PENDING | TOTAL | START                  
---|--------------------------------|-----------|---------|--------|---------|-------|------------------------
14 | Run ls -la /                   | queued    | N/A     | N/A    | N/A     | N/A   | 2019-07-09 12:10:00 UTC

# hammer job-invocation cancel --id 14 --organization-id 1
Could not cancel the job invocation:
  ERF42-5227 [Foreman::Exception]: unknown parent permission for api/v2/job_invocations#cancel

Comment 3 Marek Hulan 2019-08-09 09:09:36 UTC
Created redmine issue https://projects.theforeman.org/issues/27573 from this bug

Comment 4 Bryan Kearney 2019-08-20 10:06:35 UTC
Upstream bug assigned to aruzicka

Comment 5 Bryan Kearney 2019-08-20 10:06:37 UTC
Upstream bug assigned to aruzicka

Comment 6 Bryan Kearney 2019-08-20 14:06:35 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/27573 has been resolved.

Comment 8 Peter Dragun 2019-08-26 08:59:36 UTC
Verified on Satellite 6.6 snap 17 using steps from problem descrition. Job can be cancelled without exceptions.

Comment 9 Bryan Kearney 2019-10-22 19:48:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:3172


Note You need to log in before you can comment on or make changes to this bug.