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 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os + from charmhelpers.core.hookenv import ( service_name, is_relation_made, @@ -47,6 +49,9 @@ class CephBackupSubordinateContext(OSContextGenerator): "sections": { 'DEFAULT': [ ('backup_driver', backup_driver), + ('backup_ceph_conf', + os.path.join('/var/lib/charm', + service, 'ceph.conf')), ('backup_ceph_pool', service), ('backup_ceph_user', service), ] 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): sub = ('{"cinder": {"/etc/cinder/cinder.conf": {"sections": ' '{"DEFAULT": [' '["backup_driver", "cinder.backup.drivers.ceph"], ' + '["backup_ceph_conf", ' + '"/var/lib/charm/cinder-backup/ceph.conf"], ' '["backup_ceph_pool", "cinder-backup"], ' '["backup_ceph_user", "cinder-backup"]]}}}}') 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): {'sections': {'DEFAULT': [('backup_driver', 'cinder.backup.drivers.ceph'), + ('backup_ceph_conf', + '/var/lib/charm/' + 'cinder-backup-ut/ceph.conf'), ('backup_ceph_pool', 'cinder-backup-ut'), ('backup_ceph_user',