Do not grant caps if pool name is empty

The openstack_keys map can have permissions for an empty pool
which results in an invalid kerying.

Co-Authored-By: Giulio Fidente <gfidente@redhat.com>
Change-Id: Ic5ae53d9ab52ea5e7c3f75a240a7a7f4bb5632ba
Closes-Bug: 1776987
(cherry picked from commit 9746e2f9bb)
This commit is contained in:
Giulio Fidente 2018-06-18 12:13:05 +02:00 committed by John Fulton
parent a4b295f27d
commit 70271cd94d
1 changed files with 17 additions and 17 deletions

View File

@ -274,23 +274,23 @@ outputs:
mgr_cap: "allow *"
mon_cap: "profile rbd"
osd_cap:
str_replace:
template: 'profile rbd pool=CEPH_CLIENT_POOLS'
params:
CEPH_CLIENT_POOLS:
list_join:
- ', profile rbd pool='
- list_concat_unique:
- - {get_param: CinderRbdPoolName}
- {get_param: CinderBackupRbdPoolName}
- {get_param: NovaRbdPoolName}
- {get_param: GlanceRbdPoolName}
- {get_param: GnocchiRbdPoolName}
# CinderRbdExtraPools is a list (do not indent further)
- {get_param: CinderRbdExtraPools}
- yaql:
data: {get_param: CephPools}
expression: $.data.select($.name)
list_join:
- ', '
- repeat:
template: 'profile rbd pool=<%pool%>'
for_each:
<%pool%>:
list_concat_unique:
- - {get_param: CinderRbdPoolName}
- {get_param: CinderBackupRbdPoolName}
- {get_param: NovaRbdPoolName}
- {get_param: GlanceRbdPoolName}
- {get_param: GnocchiRbdPoolName}
# CinderRbdExtraPools is a list (do not indent further)
- {get_param: CinderRbdExtraPools}
- yaql:
data: {get_param: CephPools}
expression: $.data.select($.name)
mode: "0600"
- name:
list_join: