From c82e9308726eb9105a20d542d1bbd7a2f816a2a8 Mon Sep 17 00:00:00 2001 From: zhihui wu Date: Thu, 27 Apr 2017 06:08:23 +0800 Subject: bugfix: regex node role In NEC pod based with apex, node role is incorrectly regexed. Change-Id: I90d5eb92e6eec4abf850137f50ffc4df02257615 Signed-off-by: zhihui wu --- qtip/ansible_library/modules/apex_generate_inventory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qtip/ansible_library/modules/apex_generate_inventory.py b/qtip/ansible_library/modules/apex_generate_inventory.py index 7c6c3b63..b1cc976d 100644 --- a/qtip/ansible_library/modules/apex_generate_inventory.py +++ b/qtip/ansible_library/modules/apex_generate_inventory.py @@ -73,7 +73,7 @@ def generate_inventory(baremetal_info, server_info): for node in baremetal_info: if node['Provisioning State'].lower() == 'active': - role = re.findall('.+profile:(\w+)$', node['Properties']['capabilities'])[0] + role = re.findall('.*profile:(compute|control)', node['Properties']['capabilities'])[0] for server in server_info: if server['ID'] == node['Instance UUID']: node_ip = re.findall('.+=(\d+.\d+.\d+.\d+)$', server['Networks'])[0] -- cgit 1.2.3-korg