Non-string inputs cause error in os-refresh-config

Bug #1333992 reported by Steve McLellan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Heat Templates
Fix Committed
Undecided
Steve McLellan

Bug Description

Given the template fragment below, which passes an integer input value to a heat SW config deployment, os-refresh-config fails with the error:

[2014-06-24 19:08:01,663] (heat-config) [DEBUG] Running /var/lib/heat-config/heat-config-script/1f618dbe-8384-4e7c-9083-2a6724140005
Traceback (most recent call last):
  File "/var/lib/heat-config/hooks/script", line 79, in <module>
    sys.exit(main(sys.argv))
  File "/var/lib/heat-config/hooks/script", line 49, in main
    stderr=subprocess.PIPE, env=env)
  File "/usr/lib/python2.7/subprocess.py", line 709, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1326, in _execute_child
    raise child_exception
TypeError: execve() arg 3 contains a non-string value

If `input1` is changed to "100", it works as expected. The bug is in 55-heat-config; it needs to iterate over c['inputs'] and replace all "value"s with their string arguments.

heat_template_version: '2013-05-23'

resources:
  execve:
    properties:
      flavor: m1.small
      image: Ubuntu 13.10 Heat SW config
      key_name: devstack
      user_data_format: SOFTWARE_CONFIG
    type: OS::Nova::Server

  execve-test_heat_sw:
    properties:
      config: '#!/bin/bash

       echo "Input values was input1" | tee /tmp/test-heat.txt

      '

      group: script
      inputs:
        - name: input1

    type: OS::Heat::SoftwareConfig
  execve-test_heat_sw_deployment:
    properties:
      config: {get_resource: execve-test_heat_sw}
      server: {get_resource: execve}
      input_values:
        input1: 100
    type: OS::Heat::SoftwareDeployment

Steve McLellan (sjmc7)
Changed in heat-templates:
assignee: nobody → Steve McLellan (sjmc7)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat-templates (master)

Fix proposed to branch: master
Review: https://review.openstack.org/102343

Changed in heat-templates:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat-templates (master)

Reviewed: https://review.openstack.org/102343
Committed: https://git.openstack.org/cgit/openstack/heat-templates/commit/?id=8358a56053be8525da12c00276c9c2933224a4f5
Submitter: Jenkins
Branch: master

commit 8358a56053be8525da12c00276c9c2933224a4f5
Author: Steve McLellan <email address hidden>
Date: Tue Jun 24 15:45:08 2014 -0500

    Convert input values to str

    If non-string values are provided to a software deployment,
    os-refresh-config fails with:
      'TypeError: execve() arg 3 contains a non-string value'

    Patch converts all values to strings if they should be strings.

    Change-Id: Ifa442538da063e1f3034d02e9cc4f5ba6494206a
    Closes-Bug: #1333992

Changed in heat-templates:
status: In Progress → Fix Committed
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.