From 7b636033ee5e40ba90bce1fa95fe5432e344acfc Mon Sep 17 00:00:00 2001 From: Doug Szumski Date: Tue, 3 Sep 2019 17:42:19 +0100 Subject: [PATCH] Fix Nova cell search The output from `nova-manage cell_v2 list_cells --verbose` contains an extra column, stating whether the cell is enabled or not. This means that the regex never matches, so existing_cells is always empty. This fix updates the regex by adding a match group for this field which may be used in a later change. Unfortuately the CLI doesn't output in JSON format, which would make this a lot less messy. Closes-Bug: #1842460 Change-Id: Ib6400b33785f3ef674bffc9329feb3e33bd3f9a3 --- ansible/roles/nova/tasks/create_cells.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/roles/nova/tasks/create_cells.yml b/ansible/roles/nova/tasks/create_cells.yml index c46e2b4226..1da1188ab2 100644 --- a/ansible/roles/nova/tasks/create_cells.yml +++ b/ansible/roles/nova/tasks/create_cells.yml @@ -55,10 +55,10 @@ # cell0), followed by two other columns, the first containing the transport # URL and the second the database connection. For example: # - # | None | 68a3f49e-27ec-422f-9e2e-2a4e5dc8291b | rabbit://openstack:password@1.2.3.4:5672 | mysql+pymysql://nova:password@1.2.3.4:3306/nova | + # | None | 68a3f49e-27ec-422f-9e2e-2a4e5dc8291b | rabbit://openstack:password@1.2.3.4:5672 | mysql+pymysql://nova:password@1.2.3.4:3306/nova | False | # # NOTE(priteau): regexp doesn't support passwords containing spaces - regexp: '\| +(?!00000000-0000-0000-0000-000000000000)([0-9a-f\-]+) +\| +([^ ]+) +\| +([^ ]+) +\|$' + regexp: '\| +(?!00000000-0000-0000-0000-000000000000)([0-9a-f\-]+) +\| +([^ ]+) +\| +([^ ]+) +\| +([^ ]+) +\|$' set_fact: existing_cells: "{{ existing_cells_list.stdout | regex_findall(regexp, multiline=True) }}" run_once: True