Provider resource with URL fails template validate, builds successfully

Bug #1489058 reported by Drago
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
New
Undecided
Unassigned
python-heatclient
New
Undecided
Unassigned

Bug Description

Given a template:

heat_template_version: 2013-05-23
resources:
  provider_resource:
    type: https://gist.githubusercontent.com/dragorosson/91e4ab99ffb600e8f7d4/raw/a5d1029371065435fc2d2ac5d13eb4a6e405d200/provider_resource.yaml

With a provider resource:

heat_template_version: 2013-05-23
resources:
  server:
    type: OS::Heat::RandomString

URLs for these templates:
https://gist.githubusercontent.com/dragorosson/2ff5f5627e0b3650982b/raw/b58069ae5d4097e067faa37d9a828baf3aefcf99/provider_template_test.template
https://gist.githubusercontent.com/dragorosson/91e4ab99ffb600e8f7d4/raw/a5d1029371065435fc2d2ac5d13eb4a6e405d200/provider_resource.yaml

If we try to validate this template, it fails:

heat template-validate -u https://gist.githubusercontent.com/dragorosson/2ff5f5627e0b3650982b/raw/b58069ae5d4097e067faa37d9a828baf3aefcf99/provider_template_test.template

ERROR: Could not fetch remote template "https://gist.githubusercontent.com/dragorosson/91e4ab99ffb600e8f7d4/raw/
a5d1029371065435fc2d2ac5d13eb4a6e405d200/provider_resource.yaml": Invalid URL scheme https

However, if we do stack-create, it succeeds:

heat stack-create -u https://gist.git
hubusercontent.com/dragorosson/2ff5f5627e0b3650982b/raw/b58069ae5d4097e067faa37d9a828baf3aefcf99/provider_templa
te_test.template test_stack

+--------------------------------------+--------------+--------------------+--------------------
| id | stack_name | stack_status | creation_time
+--------------------------------------+--------------+--------------------+--------------------
| 25b5ff8c-4834-42a4-9389-9a1c4a629461 | test_stack | CREATE_IN_PROGRESS | 2015-08-26T15:45:34
+--------------------------------------+--------------+--------------------+--------------------

...

+--------------------------------------+--------------+-----------------+---------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+--------------+-----------------+---------------------+
| 25b5ff8c-4834-42a4-9389-9a1c4a629461 | test_stack | CREATE_COMPLETE | 2015-08-26T15:45:34 |
+--------------------------------------+--------------+-----------------+---------------------+

Drago (dragorosson)
description: updated
description: updated
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

Also adding python-heatclient. Likely this is invalid for heat because heatclient isn't resolving the URLs first for template-validate calls.

Rico Lin (rico-lin)
Changed in python-heatclient:
assignee: nobody → Rico Lin (rico-lin)
Changed in heat:
assignee: nobody → Rico Lin (rico-lin)
Revision history for this message
Steven Hardy (shardy) wrote :

> Also adding python-heatclient. Likely this is invalid for heat because heatclient isn't resolving the URLs first for template-validate calls.

Actually, I think it is:

https://github.com/openstack/python-heatclient/blob/master/heatclient/v1/shell.py#L721

However we're then not reading that parameter in the template_validate API (or in the API->engine RPC interface)

This is all part of the larger problem that I was aiming to solve with the recursive validation BP, e.g the template_validate call can't handle any validation at all of nested templates, obviously getting the nested files passed in is the first part of solving that.

This is somewhat related to https://bugs.launchpad.net/heat/+bug/1467573 - the stack-create validate path and the template-validate logic have diverged, so we probably want to refactor & align them more closely. The risk there is we end up re-implementing template-preview (which also doesn't work with nested stacks incidentally, or at least doesn't expose any information about them) which has efficiency issues with large stacks.

So tl;dr - I think we can resolve this as part of the implementation of recursive-validation (I'm working with jdob on this, not yet clear if it'll make the cut for Liberty)

Revision history for this message
Rico Lin (rico-lin) wrote :

Agree, we can add validation to template_validate once recursive-validation is done. otherwise we also can all the original validation to template_validate and replace it by recursive-validation later, and we can make sure it solved by Liberty by this way.

Rico Lin (rico-lin)
Changed in heat:
assignee: Rico Lin (rico-lin) → nobody
Changed in python-heatclient:
assignee: Rico Lin (rico-lin) → nobody
Changed in python-heatclient:
assignee: nobody → zhangdetong (zhangdetong)
Changed in heat:
assignee: nobody → zhangdetong (zhangdetong)
Changed in heat:
assignee: zhangdetong (zhangdetong) → nobody
Changed in python-heatclient:
assignee: zhangdetong (zhangdetong) → nobody
Revision history for this message
zhangdetong (zhangdetong) wrote :

Hello Drago,
I think this issue does not exists any more, am i right?

Rico Lin (rico-lin)
Changed in heat:
milestone: none → no-priority-tag-bugs
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.