From d062507ef5794fbc8720eeee7d0f9804e23c3136 Mon Sep 17 00:00:00 2001 From: okozachenko Date: Mon, 1 Nov 2021 08:42:51 +0100 Subject: [PATCH] Change policy file format to yaml https://governance.openstack.org/tc/goals/completed/wallaby/migrate-policy-format-from-json-to-yaml.html Change-Id: I487bbe982b83db5e1815a4c8a06d5fd0e203e8ee --- README.rst | 8 ++++---- monitoring/conf/monitoring_policy.json | 8 -------- monitoring/conf/monitoring_policy.yaml | 4 ++++ monitoring/config/local_settings.py | 2 +- 4 files changed, 9 insertions(+), 13 deletions(-) delete mode 100644 monitoring/conf/monitoring_policy.json create mode 100644 monitoring/conf/monitoring_policy.yaml diff --git a/README.rst b/README.rst index c343ab5a..1e011c1a 100644 --- a/README.rst +++ b/README.rst @@ -34,8 +34,8 @@ Devstack Deployment Set Up ln -sf $(pwd)/../monasca-ui/monitoring/enabled/_50_admin_add_monitoring_panel.py \ $(pwd)/openstack_dashboard/enabled/_50_admin_add_monitoring_panel.py - ln -sf $(pwd)/../monasca-ui/monitoring/conf/monitoring_policy.json \ - $(pwd)/openstack_dashboard/conf/monitoring_policy.json + ln -sf $(pwd)/../monasca-ui/monitoring/conf/monitoring_policy.yaml \ + $(pwd)/openstack_dashboard/conf/monitoring_policy.yaml ln -sfF $(pwd)/../monasca-ui/monitoring $(pwd)/monitoring - Collect static files, run tests @@ -89,8 +89,8 @@ Set up Monasca-UI ln -sf $(pwd)/../monasca-ui/monitoring/enabled/_50_admin_add_monitoring_panel.py \ $(pwd)/openstack_dashboard/enabled/_50_admin_add_monitoring_panel.py - ln -sf $(pwd)/../monasca-ui/monitoring/conf/monitoring_policy.json \ - $(pwd)/openstack_dashboard/conf/monitoring_policy.json + ln -sf $(pwd)/../monasca-ui/monitoring/conf/monitoring_policy.yaml \ + $(pwd)/openstack_dashboard/conf/monitoring_policy.yaml ln -sfF $(pwd)/../monasca-ui/monitoring $(pwd)/monitoring ./run_tests #load monasca-client into virtualenv diff --git a/monitoring/conf/monitoring_policy.json b/monitoring/conf/monitoring_policy.json deleted file mode 100644 index 2e274ac5..00000000 --- a/monitoring/conf/monitoring_policy.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "monasca_user_role": "role:monasca-user", - - "default": "@", - - "monitoring:monitoring": "rule:monasca_user_role", - "monitoring:kibana_access": "rule:monasca_user_role" -} diff --git a/monitoring/conf/monitoring_policy.yaml b/monitoring/conf/monitoring_policy.yaml new file mode 100644 index 00000000..50e40d6d --- /dev/null +++ b/monitoring/conf/monitoring_policy.yaml @@ -0,0 +1,4 @@ +"monasca_user_role": "role:monasca-user" +"default": "@" +"monitoring:monitoring": "rule:monasca_user_role" +"monitoring:kibana_access": "rule:monasca_user_role" \ No newline at end of file diff --git a/monitoring/config/local_settings.py b/monitoring/config/local_settings.py index 2d6986a5..15b40f1a 100644 --- a/monitoring/config/local_settings.py +++ b/monitoring/config/local_settings.py @@ -117,5 +117,5 @@ OPENSTACK_SSL_NO_VERIFY = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False) OPENSTACK_SSL_CACERT = getattr(settings, 'OPENSTACK_SSL_CACERT', None) POLICY_FILES = getattr(settings, 'POLICY_FILES', {}) -POLICY_FILES.update({'monitoring': 'monitoring_policy.json',}) # noqa +POLICY_FILES.update({'monitoring': 'monitoring_policy.yaml',}) # noqa setattr(settings, 'POLICY_FILES', POLICY_FILES)