Bug 2223327 - job templates are missing the correct org/loc after import with hammer
Summary: job templates are missing the correct org/loc after import with hammer
Keywords:
Status: NEW
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Remote Execution
Version: 6.13.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-17 11:38 UTC by Stefan Meyer
Modified: 2023-07-18 00:19 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Stefan Meyer 2023-07-17 11:38:17 UTC
Description of problem:
- hammer does not assign all Locations and Organisations when importing a Job Template
- It seems hammer only adds the Job Template to the default Org/Loc

Version-Release number of selected component (if applicable):
- Satellite 6.12.z
- Satellite 6.13.z

How reproducible:
- Everytime you import an previously exported Job Template

Steps to Reproduce:
1. Have at least 2 Locations and Organisations in Satellite

2. Create a Job Template with the name "test" (see example below)

3. Assign both Locations and Organisations in the Job Template
   # hammer job-template update --organizations aaxc,redhat --locations lab,muc --name test

4. Check if the Job Template test has both locations and organisations
   # hammer job-template info --name test
   ID:            252
   Name:          test
   Job Category:  Miscellaneous
   Provider:      script
   Type:          job_template
   Description:
   Inputs:
   Locations:
    lab
    muc
   Organizations:
    aaxc
    redhat

5. Export the Job Template
   # hammer job-template export --name test > test.template

6. Remove the Job Template with the name "test"
   # hammer job-template delete --name test

7. Import the previously exported template "test"
   # hammer job-template import --file test.template

8. Get information for Job Template with the name "test"
   # hammer job-template info --name test
   ID:            252
   Name:          test
   Job Category:  Miscellaneous
   Provider:      script
   Type:          job_template
   Description:
   Inputs:
   Locations:
    lab
   Organizations:
    redhat


Actual results:
- The imported Job Template is missing one Org/Loc

Expected results:
- All exported information should re-import correctly

Additional info:

- Example Job Template:
-------------------------
<%#
name: test
snippet: false
model: JobTemplate
job_category: Miscellaneous
provider_type: script
kind: job_template
organizations:
- aaxc
- redhat
locations:
- lab
- muc
%>

echo test
-------------------------


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