From 26ea79f0a3fd79ee184c0d215d59d78959d6bf3e Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Mon, 14 May 2018 11:20:35 -0700 Subject: [PATCH] (cleanup) remove usage of role_name Cleanup patch, we shouldn't need the variable anymore. Change-Id: I47e1f2aa6e6e032cac141801ad23b70429ff52c6 Depends-On: I1fe40b655195b377f6587b20d9d78c887dfd91c5 Related-Bug: #1771171 --- tripleo_common/inventory.py | 3 --- tripleo_common/templates/deployments.yaml | 4 ++-- tripleo_common/tests/test_inventory.py | 9 --------- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/tripleo_common/inventory.py b/tripleo_common/inventory.py index 8a5dc64ed..ff1faf640 100644 --- a/tripleo_common/inventory.py +++ b/tripleo_common/inventory.py @@ -241,9 +241,6 @@ class TripleoInventory(object): 'ansible_ssh_user': self.ansible_ssh_user, 'bootstrap_server_id': role_node_id_map.get( 'bootstrap_server_id'), - # Keep "role_name" until we get rid of it - # https://bugs.launchpad.net/tripleo/+bug/1771171 - 'role_name': role, 'tripleo_role_name': role, } diff --git a/tripleo_common/templates/deployments.yaml b/tripleo_common/templates/deployments.yaml index d5313bfbc..6a7a63b8a 100644 --- a/tripleo_common/templates/deployments.yaml +++ b/tripleo_common/templates/deployments.yaml @@ -1,10 +1,10 @@ - name: Lookup deployment UUID set_fact: - deployment_uuid: "{{ lookup('file', role_name ~ '/' ~ ansible_hostname ~ '/' ~ item) | from_yaml | json_query(item ~ '.id')}}" + deployment_uuid: "{{ lookup('file', tripleo_role_name ~ '/' ~ ansible_hostname ~ '/' ~ item) | from_yaml | json_query(item ~ '.id')}}" - name: "Render deployment file for {{ item }}" copy: - content: "[ {{ lookup('file', role_name ~ '/' ~ ansible_hostname ~ '/' ~ item) | from_yaml | json_query(item) }} ]" + content: "[ {{ lookup('file', tripleo_role_name ~ '/' ~ ansible_hostname ~ '/' ~ item) | from_yaml | json_query(item) }} ]" dest: "/var/lib/heat-config/tripleo-config-download/{{ item ~ '-' ~ deployment_uuid }}" become: true diff --git a/tripleo_common/tests/test_inventory.py b/tripleo_common/tests/test_inventory.py index db45bf527..d16cf46fe 100644 --- a/tripleo_common/tests/test_inventory.py +++ b/tripleo_common/tests/test_inventory.py @@ -192,19 +192,16 @@ class TestInventory(base.TestCase): 'hosts': ['cp-0'], 'vars': {'ansible_ssh_user': ansible_ssh_user, 'bootstrap_server_id': 'a', - 'role_name': 'Compute', 'tripleo_role_name': 'Compute'}}, 'Controller': { 'hosts': ['c-0', 'c-1', 'c-2'], 'vars': {'ansible_ssh_user': ansible_ssh_user, 'bootstrap_server_id': 'a', - 'role_name': 'Controller', 'tripleo_role_name': 'Controller'}}, 'CustomRole': { 'hosts': ['cs-0'], 'vars': {'ansible_ssh_user': ansible_ssh_user, 'bootstrap_server_id': 'a', - 'role_name': 'CustomRole', 'tripleo_role_name': 'CustomRole'}}, 'overcloud': { @@ -264,19 +261,16 @@ class TestInventory(base.TestCase): 'hosts': ['cp-0'], 'vars': {'ansible_ssh_user': ansible_ssh_user, 'bootstrap_server_id': 'a', - 'role_name': 'Compute', 'tripleo_role_name': 'Compute'}}, 'Controller': { 'hosts': ['c-0', 'c-1', 'c-2'], 'vars': {'ansible_ssh_user': ansible_ssh_user, 'bootstrap_server_id': 'a', - 'role_name': 'Controller', 'tripleo_role_name': 'Controller'}}, 'CustomRole': { 'hosts': ['cs-0'], 'vars': {'ansible_ssh_user': ansible_ssh_user, 'bootstrap_server_id': 'a', - 'role_name': 'CustomRole', 'tripleo_role_name': 'CustomRole'}}, 'overcloud': { 'children': ['Compute', 'Controller', 'CustomRole'], @@ -332,7 +326,6 @@ class TestInventory(base.TestCase): 'enabled_networks': ['ctlplane']}}, 'vars': {'ansible_ssh_user': ansible_ssh_user, 'bootstrap_server_id': 'a', - 'role_name': 'Compute', 'tripleo_role_name': 'Compute'}}, 'Controller': { 'hosts': { @@ -353,7 +346,6 @@ class TestInventory(base.TestCase): 'enabled_networks': ['ctlplane']}}, 'vars': {'ansible_ssh_user': ansible_ssh_user, 'bootstrap_server_id': 'a', - 'role_name': 'Controller', 'tripleo_role_name': 'Controller'}}, 'CustomRole': { 'hosts': { @@ -364,7 +356,6 @@ class TestInventory(base.TestCase): 'enabled_networks': ['ctlplane']}}, 'vars': {'ansible_ssh_user': ansible_ssh_user, 'bootstrap_server_id': 'a', - 'role_name': 'CustomRole', 'tripleo_role_name': 'CustomRole'}}, 'overcloud': {'children': {'Compute': {}, 'Controller': {},