Cinder use correct glance API when RBD enabled

The syntax of the jinja block was broken and outputted a line break
always, like this:
ok: [lsn-d6329_cinder_volumes_container-9a2bbc7d] => {
    "msg": "True\n"
}

So the resulting evaluation was always false, and glance API v1 was
used by cinder-volume, breaking the ceph CoW functionality.

This fixes the variable to eval properly as a boolean and make
Cinder use the correct glance API version.

Change-Id: I9c1f31bba80bf2591710fd4d59f320ffadaf1c8b
This commit is contained in:
Logan V 2017-02-16 19:20:00 -06:00 committed by Jesse Pretorius (odyssey4me)
parent f67dfa4c1e
commit 6bc3bf911c

View File

@ -152,7 +152,7 @@ cinder_backend_rbd_inuse: '{{ (cinder_backends|default("")|to_json).find("cinder
# cinder_backends_rbd_inuse: true if at least 1 cinder_backend on any
# cinder_volume host uses Ceph RBD
# http://stackoverflow.com/questions/9486393/jinja2-change-the-value-of-a-variable-inside-a-loop
cinder_backends_rbd_inuse: >
cinder_backends_rbd_inuse: >-
{% set _var = {'rbd_inuse': False} %}{%
for host in groups.cinder_volume %}{%
if hostvars[host].cinder_backend_rbd_inuse | bool %}{%