Bug 1313220 - Empty parameters in tripleo heat template not translated to empty hiera values
Summary: Empty parameters in tripleo heat template not translated to empty hiera values
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-heat-templates
Version: 7.0 (Kilo)
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 10.0 (Newton)
Assignee: Jiri Stransky
QA Contact: Shai Revivo
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-01 08:34 UTC by David Juran
Modified: 2016-10-10 03:51 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-10-10 03:51:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description David Juran 2016-03-01 08:34:24 UTC
Description of problem:
I've noticed that that an parameter with an empty value in our tripleo
heat templates will not translate into an empty hiera value. It just
get dropped. With a failed deployment/update as result. 

Specifically, I meant to deploy an OSP with an cinder NFS backend using
OSP-d. So setting 

parameter_defaults:
  CinderEnablaeNfsBackend: true
  CinderNfsServers: 172.31.17.4:/cinder

Right? Not so easy, deploying this fails with puppet complaining that
cinder_nfs_mount_options is not available in any Hiera data file.

Looking in overcloud-without-mergepy.yaml, CinderNfsMountOptions is
defined there with a default value of ''
So solution was to override this default, the following did the trick:

  CinderNfsMountOptions: "''"

I'm guessing this is a generic problem,
that parameters with empty values get dropped from hiera. So what would
be the best way of solving this? Should we change the syntax of how we
specify empty default values? Or is there a better way of creating the
hiera files?


Version-Release number of selected component (if applicable):
openstack-tripleo-heat-templates-0.8.6-121.el7ost

Comment 2 Jiri Stransky 2016-03-01 10:15:54 UTC
Yes, there is broken data type handling between Heat and Hiera (single-line strings are passed literally to hiera, unquoted, so e.g. a string "[1,2]" actually gets converted into an array, empty string gets converted into null value, and if you need empty string, you need to work around that by nesting the quotes "''", which will get unwrapped into hiera as '' (empty string), as you wrote above.

It's something that bites us from time to time, i fixed a part of it some time ago but not all [1], as unfortunately too much depends on the literal passing behavior now (the string->array conversion mentioned above, for example). I think it would be worth investigating if we can fix it fully, but it's an XXL task with uncertain outcome and needs to be prioritized/scheduled as such.


However, specifically for CinderNfsMountOptions there's a fix merged and backported into stable/liberty, which allows null value to be used, so the "''" workaround isn't necessary [2].

[1] https://review.openstack.org/#/c/188772/
[2] https://review.openstack.org/#/c/245225/

Comment 3 Mike Burns 2016-04-07 21:11:06 UTC
This bug did not make the OSP 8.0 release.  It is being deferred to OSP 10.


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