summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuto Murata <nobuto.murata@canonical.com>2017-08-28 23:51:45 +0700
committerNobuto Murata <nobuto.murata@canonical.com>2017-08-29 10:23:13 +0700
commit14f6f2885bf763082bd64f03c9b258b38afaff79 (patch)
tree20b91ff51a745e03383ade6b1dd1796463bf3022
parentbbe3fae336d96b77253032732e3260ec17380382 (diff)
Use proper ceph.conf generated by ceph-backup relation
When a primary Ceph cluster is used as a volume backend and a secondary cluster as a backup backend, target Ceph mon addresses will be different. But previously both Cinder volume and backup services use the same /etc/ceph/ceph.conf generated by cinder-ceph and ceph-mon relation. Instead, use separete ceph.conf files based on relation types. Change-Id: I1d82db179b41b0c01d2a217838384ac71ef7bdad Closes-Bug: #1713489
Notes
Notes (review): Verified+1: Canonical CI <uosci-testing-bot@ubuntu.com> Code-Review+2: James Page <james.page@canonical.com> Workflow+1: James Page <james.page@canonical.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Mon, 04 Sep 2017 15:53:39 +0000 Reviewed-on: https://review.openstack.org/498526 Project: openstack/charm-cinder-backup Branch: refs/heads/master
-rw-r--r--hooks/cinder_backup_contexts.py5
-rw-r--r--tests/basic_deployment.py2
-rw-r--r--unit_tests/test_cinder_backup_contexts.py3
3 files changed, 10 insertions, 0 deletions
diff --git a/hooks/cinder_backup_contexts.py b/hooks/cinder_backup_contexts.py
index ec96286..74fea97 100644
--- a/hooks/cinder_backup_contexts.py
+++ b/hooks/cinder_backup_contexts.py
@@ -12,6 +12,8 @@
12# See the License for the specific language governing permissions and 12# See the License for the specific language governing permissions and
13# limitations under the License. 13# limitations under the License.
14 14
15import os
16
15from charmhelpers.core.hookenv import ( 17from charmhelpers.core.hookenv import (
16 service_name, 18 service_name,
17 is_relation_made, 19 is_relation_made,
@@ -47,6 +49,9 @@ class CephBackupSubordinateContext(OSContextGenerator):
47 "sections": { 49 "sections": {
48 'DEFAULT': [ 50 'DEFAULT': [
49 ('backup_driver', backup_driver), 51 ('backup_driver', backup_driver),
52 ('backup_ceph_conf',
53 os.path.join('/var/lib/charm',
54 service, 'ceph.conf')),
50 ('backup_ceph_pool', service), 55 ('backup_ceph_pool', service),
51 ('backup_ceph_user', service), 56 ('backup_ceph_user', service),
52 ] 57 ]
diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py
index 1cc9516..70c7e43 100644
--- a/tests/basic_deployment.py
+++ b/tests/basic_deployment.py
@@ -400,6 +400,8 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
400 sub = ('{"cinder": {"/etc/cinder/cinder.conf": {"sections": ' 400 sub = ('{"cinder": {"/etc/cinder/cinder.conf": {"sections": '
401 '{"DEFAULT": [' 401 '{"DEFAULT": ['
402 '["backup_driver", "cinder.backup.drivers.ceph"], ' 402 '["backup_driver", "cinder.backup.drivers.ceph"], '
403 '["backup_ceph_conf", '
404 '"/var/lib/charm/cinder-backup/ceph.conf"], '
403 '["backup_ceph_pool", "cinder-backup"], ' 405 '["backup_ceph_pool", "cinder-backup"], '
404 '["backup_ceph_user", "cinder-backup"]]}}}}') 406 '["backup_ceph_user", "cinder-backup"]]}}}}')
405 expected = { 407 expected = {
diff --git a/unit_tests/test_cinder_backup_contexts.py b/unit_tests/test_cinder_backup_contexts.py
index b7386f9..250332c 100644
--- a/unit_tests/test_cinder_backup_contexts.py
+++ b/unit_tests/test_cinder_backup_contexts.py
@@ -38,6 +38,9 @@ class TestCinderBackupContext(CharmTestCase):
38 {'sections': {'DEFAULT': 38 {'sections': {'DEFAULT':
39 [('backup_driver', 39 [('backup_driver',
40 'cinder.backup.drivers.ceph'), 40 'cinder.backup.drivers.ceph'),
41 ('backup_ceph_conf',
42 '/var/lib/charm/'
43 'cinder-backup-ut/ceph.conf'),
41 ('backup_ceph_pool', 44 ('backup_ceph_pool',
42 'cinder-backup-ut'), 45 'cinder-backup-ut'),
43 ('backup_ceph_user', 46 ('backup_ceph_user',