Bug 1313220 - Empty parameters in tripleo heat template not translated to empty hiera values
Empty parameters in tripleo heat template not translated to empty hiera values
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-heat-templates (Show other bugs)
7.0 (Kilo)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 10.0 (Newton)
Assigned To: Jiri Stransky
Shai Revivo
Depends On:
  Show dependency treegraph
Reported: 2016-03-01 03:34 EST by David Juran
Modified: 2016-10-09 23:51 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-10-09 23:51:39 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description David Juran 2016-03-01 03:34:24 EST
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 

  CinderEnablaeNfsBackend: true

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):
Comment 2 Jiri Stransky 2016-03-01 05:15:54 EST
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 17:11:06 EDT
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.