Bug 1325952

Summary: Metadata isn't imported when uploading a template for remote execution
Product: Red Hat Satellite Reporter: Stephen Benjamin <stbenjam>
Component: Remote ExecutionAssignee: Stephen Benjamin <stbenjam>
Status: CLOSED ERRATA QA Contact: jcallaha
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: cwelton, jcallaha, mburgerh, stbenjam
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/13922
Whiteboard:
Fixed In Version: rubygem-foreman_remote_execution-0.3.0.5-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 11:29:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Incorrect file import none

Description Stephen Benjamin 2016-04-11 13:25:41 UTC
Description of problem:
If you use the upload functionality for a template, only the template text is used.  We need a way for a user to export/import a template with all the metadata.


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

How reproducible:
Always

Steps to Reproduce:
1. Attempt to export or import a job template

Actual results:
Metadata not included

Expected results:
Metadata included (inputs, etc).


Additional info:

Comment 2 Bryan Kearney 2016-04-14 14:11:34 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/13922 has been closed
-------------
Anonymous
Applied in changeset commit:foreman_plugin|cfab668395d40b98eeb01c1b2d050031452f6bcc.

Comment 3 Maxim Burgerhout 2016-05-06 11:29:13 UTC
While this is great (not having to create input fields manually), this change does make adding this metadata mandatory. Is that intentional? 

Asking because a template I made earlier doesn't import anymore (ISE), unless I add some metadata.

Comment 4 Stephen Benjamin 2016-05-06 13:37:41 UTC
There was no import button before this change, if you have just the contents of a template like a script, use the upload button in the New template form.

Import exports a particular format, we can't import an entire template without metadata, like the name.

Comment 5 Stephen Benjamin 2016-05-06 13:54:39 UTC
It could be possible to make importing without metadata take you to a blank form, but that should be a separate BZ I think.

Comment 6 jcallaha 2016-05-23 13:50:27 UTC
Failed QA in Satellite 6.2 Beta Snap 12.

The template exported correctly. However, when attempting to create a new template from the exported template file, the form data was not correctly populated. The text of the template was populated with the contents of the file instead. See attached image.

Comment 7 jcallaha 2016-05-23 13:52:01 UTC
Created attachment 1160638 [details]
Incorrect file import

Comment 8 Stephen Benjamin 2016-05-23 13:54:25 UTC
How did you test this? Please use the actual button labeled *IMPORT* on the main job templates index page, or the hammer cli import command.

The browse button does not import the template, as discussed in comment #3 and #4.  It's a limitation of how we get the form from foreman currently.

Comment 9 jcallaha 2016-05-23 14:06:29 UTC
After following Stephen's guidance, the template upload worked correctly. 

Verified in Satellite 6.2 Beta Snap 12.

Comment 10 Bryan Kearney 2016-07-27 11:29:01 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/RHBA-2016:1501