Update ceilometer policy management
Related: PROD-34318
Change-Id: Ic8245acfdeb845baf7f4360dab19cf7efd3f618a
diff --git a/.kitchen.yml b/.kitchen.yml
index 65e5643..c25b38d 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -15,6 +15,10 @@
grains:
noservices: True
dependencies:
+ - name: keystone
+ repo: git
+ source: https://gerrit.mcp.mirantis.com/salt-formulas/keystone
+ branch: <%=ENV['GERRIT_BRANCH'] || 'release/2019.2.0' %>
- name: linux
repo: git
source: https://gerrit.mcp.mirantis.com/salt-formulas/linux
diff --git a/ceilometer/server.sls b/ceilometer/server.sls
index 2ff9dd8..a02cce8 100644
--- a/ceilometer/server.sls
+++ b/ceilometer/server.sls
@@ -125,8 +125,7 @@
- service: ceilometer_server_services
{%- endif %}
-{%- if server.version not in ["juno", "kilo", "liberty", "mitaka", "newton", "ocata", "pike"] %}
-{#- Since Queens release `policy.json` is changed to `policy.yaml`. But default option in `oslo_policy` is `policy.json` #}
+{%- if server.version not in ["juno", "kilo", "liberty", "mitaka", "newton", "ocata"] %}
/etc/ceilometer/{{ server.get('oslo_policy', {}).get('policy_file', 'policy.json') }}:
file.managed:
- mode: 0640
@@ -146,6 +145,9 @@
- rule: {{ rule }}
- require:
- pkg: ceilometer_server_packages
+ {%- if server.version not in ["juno", "kilo", "liberty", "mitaka", "newton", "ocata"] %}
+ - file: /etc/ceilometer/{{ server.get('oslo_policy', {}).get('policy_file', 'policy.json') }}
+ {%- endif %}
{%- else %}
@@ -155,6 +157,9 @@
- name: {{ name }}
- require:
- pkg: ceilometer_server_packages
+ {%- if server.version not in ["juno", "kilo", "liberty", "mitaka", "newton", "ocata"] %}
+ - file: /etc/ceilometer/{{ server.get('oslo_policy', {}).get('policy_file', 'policy.json') }}
+ {%- endif %}
{%- endif %}
diff --git a/tests/pip_requirements.txt b/tests/pip_requirements.txt
new file mode 100644
index 0000000..940ecbb
--- /dev/null
+++ b/tests/pip_requirements.txt
@@ -0,0 +1,2 @@
+jsonschema
+setuptools<45.0.0
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index e4034f8..04752f1 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -47,7 +47,6 @@
virtualenv $VENV_DIR
source ${VENV_DIR}/bin/activate
python -m pip install salt${PIP_SALT_VERSION}
- python -m pip install jsonschema
if [[ -f ${CURDIR}/pip_requirements.txt ]]; then
python -m pip install -r ${CURDIR}/pip_requirements.txt
fi