Relative paths to Heat template resources do not work in horizon

Bug #1467781 reported by Ma Bo on 2015-06-23
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)

Bug Description

Steps to reproduce the problem:
1. files list
    # filename: f.yaml
    heat_template_version: 2013-05-23
       type: s.yaml
    # filename: s.yaml
    heat_template_version: 2013-05-23
2. Put above two files in a http server, use horizon to create stack

Beside the tempalte-validate error, horizon will say `s.yaml' not found so can not create stack.

While below command works:
heat stack-create -u http://.../f.yaml f

The same situation for get file found in horizon

Yes, the bug can be fixed in horizon side but if we can fix it in heat client side it will benefit all the application based on heat.

Ma Bo (mabo-1) on 2015-06-23
summary: - get file not work in horizon
+ Stack resources not work in horizon
description: updated
description: updated
description: updated

What do you expect the out come to be?
In this use case where is the s.yaml physically situated?

Let's say we have this:
1. in a local directory I have:
    $ ls
     s.yaml f.yaml
2. I click the upload template button and select f.yaml.
     (this AFAIK is done by horizon)
3. click "create stack"
     here heatclient does not have the original directory that f.yaml was in (afaik)

The only thing I can think of is to supply a helper function that be used to retrieve a list of required files.
But it would be good to know what would be useful from horizon's point of view.

Ma Bo (mabo-1) wrote :

s.yaml and f.yaml is put on a http server, say:

When I am using heat stack-create -u f, it works well. When I am using horizon, input as url input, it reports error. I checked the code and found heat CLI read the contents and do transform, and put the template contents in `template`, while horizon just put the url to `template_url` and pass it to heat. Below is code, horizon:
  kwargs = {}
        if cleaned['template_data']:
            kwargs['template'] = cleaned['template_data']
            kwargs['template_url'] = cleaned['template_url']
heat cli:
tpl_files, template = template_utils.get_template_contents(...
'template': template,

You can see horizon is passing the template_url to heat client, so heat client should know the original url. So it should work.

Steve Baker (steve-stevebaker) wrote :

The following scenario should work once there are changes to horizon:
- The base template is a network URL
- Other referenced templates are relative URLs or network URLs

When a stack is created from a network URL, horizon needs to call template_utils.get_template_contents and template_utils.process_multiple_environments_and_files, just like the CLI stack-create does:

Then all necessary files should be collected for the stack create call.

There also needs to be some mechanism to ensure that any attempt to load a file:// URL will fail (this may require a change to heatclient to add a global or a function argument for disabled URL schemes)

Changed in python-heatclient:
status: New → Triaged
importance: Undecided → Medium
Rabi Mishra (rabi) on 2015-06-30
Changed in python-heatclient:
assignee: nobody → Rabi Mishra (rabi)
tags: added: heat
Rabi Mishra (rabi) on 2016-07-13
Changed in python-heatclient:
assignee: Rabi Mishra (rabi) → nobody
Zane Bitter (zaneb) on 2017-01-06
summary: - Stack resources not work in horizon
+ Relative paths to stack resources do not work in horizon
summary: - Relative paths to stack resources do not work in horizon
+ Relative paths to template resources do not work in horizon
summary: - Relative paths to template resources do not work in horizon
+ Relative paths to Heat template resources do not work in horizon
Zane Bitter (zaneb) on 2017-01-06
Changed in horizon:
status: New → Confirmed
Duc Truong (dkt26111) wrote :
Gary W. Smith (gary-w-smith) wrote :

Marking invalid be Duc Truong's comment. If you are able to reproduce this, then feel free to reopen it.

Changed in horizon:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers