Bug 1319919 - [RFE] get_file doesn't work in the global environment
Summary: [RFE] get_file doesn't work in the global environment
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-heat
Version: 7.0 (Kilo)
Hardware: Unspecified
OS: Unspecified
low
high
Target Milestone: Upstream M3
: ---
Assignee: Zane Bitter
QA Contact: Ronnie Rasouli
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-21 20:04 UTC by Eric Rich
Modified: 2020-07-16 08:43 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-14 15:54:30 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1454401 0 None None None 2016-03-21 21:27:13 UTC
OpenStack gerrit 209439 0 None ABANDONED Allow load global template for template resouce 2020-12-04 00:50:11 UTC

Description Eric Rich 2016-03-21 20:04:40 UTC
Description of problem:

https://bugs.launchpad.net/heat/+bug/1454401


Version-Release number of selected component (if applicable): 7.0


How reproducible: 100% 

Steps to Reproduce:

  user_data:
    type: string
    default: "file:///root/heat-templates/samples/user_data.sh"

resources:

  instance:
    #depends_on: [network_port_resource]
    type: OS::Nova::Server
    properties:
      name: { get_param: instance_name }
      key_name: { get_param: ssh_key_name }
      image: { get_param: image_name }
      flavor: { get_param: image_flavor }
      networks:
        - port: { get_param: network_port_resource }
      availability_zone: { get_param: az }
      user_data_format: RAW
      user_data:
        #get_file: "file:///root/heat-templates/samples/user_data.sh" ### Works
        get_file: { get_param: user_data }   
          ### Does not work (its precised because of the note in http://docs.openstack.org/developer/heat/template_guide/hot_spec.html#get-file)

Actual results: Fails to Create Instance, "No content found in the "files" section for get_file path when" Error

Expected results: Suscessfull Stack creation with a customizable cloud-init file. 

Additional info:

Comment 2 Zane Bitter 2016-03-21 20:22:52 UTC
It works fine AFAIK. What doesn't work is that the client doesn't automatically upload the file in question the way it does if a filename appears directly within the {get_file: <filename>} intrinsic in the template. It pretty much can't know without completely executing heat-engine's environment and parameter resolution code in the client, and even then there are circumstances that it may not be able to for lack of data (e.g. PATCH update, where some of the parameter values are not known to the client).

It'd be nice to have a way of forcing extra file inclusions on the CLI for those who do want to use this pattern. The server side will certainly accept any files you want to upload there.

Comment 3 Zane Bitter 2016-03-21 20:29:17 UTC
Sorry, ignore previous comment, this RFE refers to the *global* environment, not the environment passed by the user. So the note in http://docs.openstack.org/developer/heat/template_guide/hot_spec.html#get-file has nothing to do with it.

This seems inherently insecure to me.

Comment 4 Steve Baker 2016-03-21 21:27:14 UTC
There is an upstream change, but it needs work and is currently looking likely to miss mitaka-rc2

Comment 9 Zane Bitter 2017-01-13 17:15:14 UTC
Current status: upstream reviews are still ongoing.

Comment 11 Zane Bitter 2017-01-26 15:08:44 UTC
Didn't make upstream feature freeze for Ocata, so bumping to OSP 12.

Comment 18 Jaromir Coufal 2019-06-14 15:54:30 UTC
Obsolete RFE without enough of backed demand.


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