From e6e48c30e37af0b07567ad08e44eab65e7b0ae6d Mon Sep 17 00:00:00 2001
From: Bertrand Lallau <bertrand.lallau@thalesgroup.com>
Date: Mon, 24 Apr 2017 10:18:11 +0200
Subject: [PATCH] Tempest: remove all oslo.policy related stuff

The OpenStack Integration Test Suite (Tempest) doesn't use oslo.policy
library.
oslo.policy is not used in codebase and not set in requirements.txt:
https://github.com/openstack/tempest/blob/master/requirements.txt#L14

All policy.json related stuff must be removed.

Change-Id: I0d8ee710979a7eebba1e8fc176450e4c0bcbe757
---
 ansible/roles/tempest/handlers/main.yml         |  2 --
 ansible/roles/tempest/tasks/config.yml          | 17 -----------------
 ansible/roles/tempest/templates/tempest.json.j2 |  7 -------
 3 files changed, 26 deletions(-)

diff --git a/ansible/roles/tempest/handlers/main.yml b/ansible/roles/tempest/handlers/main.yml
index 64c0f48e14..09fa546980 100644
--- a/ansible/roles/tempest/handlers/main.yml
+++ b/ansible/roles/tempest/handlers/main.yml
@@ -4,7 +4,6 @@
     service: "{{ tempest_services[service_name] }}"
     config_json: "{{ tempest_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
     tempest_conf: "{{ tempest_confs.results|selectattr('item.key', 'equalto', service_name)|first }}"
-    policy_json: "{{ tempest_policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
     tempest_container: "{{ check_tempest_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
   kolla_docker:
     action: "recreate_or_restart_container"
@@ -19,5 +18,4 @@
     - service.enabled | bool
     - config_json.changed | bool
       or tempest_conf.changed | bool
-      or policy_json.changed | bool
       or tempest_container.changed | bool
diff --git a/ansible/roles/tempest/tasks/config.yml b/ansible/roles/tempest/tasks/config.yml
index 374b781686..6d45a22e78 100644
--- a/ansible/roles/tempest/tasks/config.yml
+++ b/ansible/roles/tempest/tasks/config.yml
@@ -37,23 +37,6 @@
   notify:
     - Restart tempest container
 
-- name: Check if policies shall be overwritten
-  local_action: stat path="{{ node_custom_config }}/tempest/policy.json"
-  register: tempest_policy
-
-- name: Copying over existing policy.json
-  template:
-    src: "{{ node_custom_config }}/tempest/policy.json"
-    dest: "{{ node_config_directory }}/{{ item.key }}/policy.json"
-  register: tempest_policy_jsons
-  when:
-    - tempest_policy.stat.exists
-    - inventory_hostname in groups[item.value.group]
-    - item.value.enabled | bool
-  with_dict: "{{ tempest_services }}"
-  notify:
-    - Restart tempest container
-
 - name: Check tempest containers
   kolla_docker:
     action: "compare_container"
diff --git a/ansible/roles/tempest/templates/tempest.json.j2 b/ansible/roles/tempest/templates/tempest.json.j2
index 36ddc9ac56..3ff5ea788e 100644
--- a/ansible/roles/tempest/templates/tempest.json.j2
+++ b/ansible/roles/tempest/templates/tempest.json.j2
@@ -6,13 +6,6 @@
             "dest": "/etc/tempest/tempest.conf",
             "owner": "root",
             "perm": "0600"
-        },
-        {
-            "source": "{{ container_config_directory }}/policy.json",
-            "dest": "/etc/tempest/policy.json",
-            "owner": "tempest",
-            "perm": "0600",
-            "optional": true
         }
     ]
 }
-- 
GitLab