Wrong 'foreign_input_sets -> template' name on export

Problem:
Hi, exported templates with ‘foreman_template’ plug-in, with foreign inputs, are generated with its own template name instead of the name of foreign template

Expected outcome:

Export with the name of the foreign input template instead of his own.

Foreman and Proxy versions:

1.24.2

Foreman and Proxy plugin versions:

foreman_templates 7.0.6

Distribution and version:

Red Hat Enterprise Linux Server 7.7

Other relevant data:

Example:

-bash-4.2$ cat test_-_foreign_input_test_1.erb
<%#
name: TEST - Foreign input test 1
snippet: false
model: JobTemplate
job_category: gevIT
foreign_input_sets:

  • include: sample_input
    include_all: false
    template: TEST - Foreign input test 1 <<<<------- wrong foreign template name, exported with it’s own template name
    provider_type: Ansible
    kind: job_template
    organizations:

  • TEST_ORG
    locations:

  • Default Location
    %>

  • name: “TEST”
    hosts: all
    gather_facts: False
    vars:
    tasks:

    • debug: msg=“Host-> <%=@host.shortname%>”

-bash-4.2$ hammer -v import-templates --filter=‘TEST - Foreign input test 1’

Name: TEST - Foreign input test 1
Type: job_template
Imported: false

Errors:
Validation:
1) Base: ERF98-1781 [ForeignInputSet::CircularDependencyError]: Circular dependency detected in foreign input set ‘TEST - Foreign input test 1’ -> ‘TEST - Foreign input test 1’. Templates stack:
2) Foreign_input_sets: is invalid
3) Foreign_input_sets.base: ERF98-1781 [ForeignInputSet::CircularDependencyError]: Circular dependency detected in foreign input set ‘TEST - Foreign input test 1’ -> ‘TEST - Foreign input test 1’. Templates stack:

This looks as a valid bug in Foreman core, could you please open a redmine issue for this in our tracker? https://projects.theforeman.org/projects/foreman/issues/new

Thanks Marek, issue opened with Bug #30074 (Bug #30074: Wrong ‘foreign_input_sets -> template’ name on export - Foreman)