Bug 1728441

Summary: hammer report-template list gives 404 if called with saved default organization or location
Product: Red Hat Satellite Reporter: gtaylor
Component: ReportingAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.5.0CC: arahaman, aruzicka, bbuckingham, bkearney, david.logan, inecas, jcallaha, katello-qa-list, mhulan, mmithaiw, mshira, oprazak, oshtaier, pondrejk, rankumar, satellite6-bugs, sjayapra, wpinheir
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1368173 Environment:
Last Closed: 2020-06-09 10:48:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1368173    
Bug Blocks:    

Description gtaylor 2019-07-10 00:42:29 UTC
+++ This bug was initially created as a clone of Bug #1368173 +++

Description of problem:

-- running "hammer report-template list" returns:
404 Resource Not Found

Reproducer: 
hammer>  defaults add --param-value="1" --param-name="organization_id"
Added organization_id default-option with value 1.

hammer> defaults add --param-value="2" --param-name="location_id"
Added location_id default-option with value 2.

hammer> defaults list
----------------|------
PARAMETER       | VALUE
----------------|------
organization_id | 1
location_id     | 2
----------------|------

hammer> report-template list
404 Not Found

hammer> defaults delete  --param-name="organization_id"
organization_id was deleted successfully.

hammer> defaults delete  --param-name="location_id"
location_id was deleted successfully.

hammer> report-template list
----|------------------
ID  | NAME
----|------------------
433 | Applicable errata
434 | Host statuses CSV
436 | Registered hosts
435 | Subscriptions
----|------------------


Version-Release number of selected component (if applicable):

   satellite-6.5.0-11.el7sat.noarch

Additional info:
Customer also uses defaults.yml something like this:

# cat defaults.yml
---
:defaults:
  :organization:
    :value: acme
  :organization_id:
    :value: '1'

Expected results:
The command should work with the default organization and location settings

Comment 4 Adam Ruzicka 2019-07-10 06:37:58 UTC
The title talks about job templates, but all the commands mentioned are working with report templates. Just to clarify, which one is correct?

Comment 5 Adam Ruzicka 2019-07-10 06:39:33 UTC
Please disregard my previous comment, for some reason the email I got about this from bugzilla had wrong subject

Comment 7 Adam Ruzicka 2019-07-31 12:19:07 UTC
Created redmine issue https://projects.theforeman.org/issues/27480 from this bug

Comment 8 Shira Maximov 2020-06-09 10:48:44 UTC

*** This bug has been marked as a duplicate of bug 1680567 ***