From d0d2ac8864504b62a75f15de5824501152b0d7e0 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Fri, 4 Oct 2019 12:20:34 +0000 Subject: [PATCH] Gate sending ceph pool creation request. Add new state ceph.create_pool.req.sent to gate sending the ceph pool creation request. This fixes a problem where the changed method in requires of ceph-client interface raises the '{relation_name}.pools.available' state but the create_pool method then removes it again. Also remove snap functional tests as they are no longer needed since that install method via charms is not actively supported. Change-Id: Iaf986d24f005bcc7c8f485cfc2eb1775e6dbbbdd Closes-Bug: #1846480 --- src/reactive/gnocchi_handlers.py | 2 ++ src/test-requirements.txt | 2 +- src/tests/gate-basic-snap-xenial-ocata | 25 ------------------------- src/tests/gate-basic-snap-xenial-pike | 25 ------------------------- unit_tests/test_gnocchi_handlers.py | 3 +++ 5 files changed, 6 insertions(+), 51 deletions(-) delete mode 100755 src/tests/gate-basic-snap-xenial-ocata delete mode 100755 src/tests/gate-basic-snap-xenial-pike diff --git a/src/reactive/gnocchi_handlers.py b/src/reactive/gnocchi_handlers.py index 5087b32..c2c414e 100644 --- a/src/reactive/gnocchi_handlers.py +++ b/src/reactive/gnocchi_handlers.py @@ -75,9 +75,11 @@ def cluster_connected(hacluster): charm_class.assess_status() +@reactive.when_not('ceph.create_pool.req.sent') @reactive.when('storage-ceph.connected') def storage_ceph_connected(ceph): ceph.create_pool(hookenv.service_name()) + reactive.set_state('ceph.create_pool.req.sent') @reactive.when('storage-ceph.available') diff --git a/src/test-requirements.txt b/src/test-requirements.txt index e56db9a..a4b77a5 100644 --- a/src/test-requirements.txt +++ b/src/test-requirements.txt @@ -15,7 +15,7 @@ aodhclient>=0.1.0 gnocchiclient>=3.1.0,<3.2.0 python-barbicanclient>=4.0.1 python-ceilometerclient>=1.5.0 -python-cinderclient>=1.4.0 +python-cinderclient>=1.4.0,<5.0.0 python-designateclient>=1.5 python-glanceclient>=1.1.0 python-heatclient>=0.8.0 diff --git a/src/tests/gate-basic-snap-xenial-ocata b/src/tests/gate-basic-snap-xenial-ocata deleted file mode 100755 index 19bd229..0000000 --- a/src/tests/gate-basic-snap-xenial-ocata +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2016 Canonical Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Amulet tests on a basic Gnocchi Charm deployment on xenial-ocata.""" - -from basic_deployment import GnocchiCharmSnapDeployment - -if __name__ == '__main__': - deployment = GnocchiCharmSnapDeployment(series='xenial', - openstack='cloud:xenial-ocata', - snap_source='snap:ocata/edge') - deployment.run_tests() diff --git a/src/tests/gate-basic-snap-xenial-pike b/src/tests/gate-basic-snap-xenial-pike deleted file mode 100755 index 9293aca..0000000 --- a/src/tests/gate-basic-snap-xenial-pike +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2016 Canonical Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Amulet tests on a basic Gnocchi Charm deployment on xenial-pike.""" - -from basic_deployment import GnocchiCharmSnapDeployment - -if __name__ == '__main__': - deployment = GnocchiCharmSnapDeployment(series='xenial', - openstack='cloud:xenial-pike', - snap_source='snap:pike/edge') - deployment.run_tests() diff --git a/unit_tests/test_gnocchi_handlers.py b/unit_tests/test_gnocchi_handlers.py index f513e3e..675a84a 100644 --- a/unit_tests/test_gnocchi_handlers.py +++ b/unit_tests/test_gnocchi_handlers.py @@ -73,6 +73,9 @@ class TestRegisteredHooks(test_utils.TestRegisteredHooks): 'init_db': ( 'db.synced', ), + 'storage_ceph_connected': ( + 'ceph.create_pool.req.sent', + ), }, } # test that the hooks were registered via the