diff options
author | zhihui wu <wu.zhihui1@zte.com.cn> | 2017-04-27 06:08:23 +0800 |
---|---|---|
committer | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-04-27 00:50:16 +0000 |
commit | c82e9308726eb9105a20d542d1bbd7a2f816a2a8 (patch) | |
tree | 483ba1edd635c9a7b0e94fe9e823d7695d945416 | |
parent | 1a017fa4bd32aac493806924e719fb866c8281e9 (diff) |
bugfix: regex node role
In NEC pod based with apex, node role is incorrectly regexed.
Change-Id: I90d5eb92e6eec4abf850137f50ffc4df02257615
Signed-off-by: zhihui wu <wu.zhihui1@zte.com.cn>
-rw-r--r-- | qtip/ansible_library/modules/apex_generate_inventory.py | 2 |
1 files changed, 1 insertions, 1 deletions
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] |