Change config parameter 'backend-name' to 'volume-backend-name'

This patchset normalizes the configuration parameter so that it
matches what other charms are already using to make thins more
uniform and consistent.

Change-Id: I65ae3b12754a78d3419c69dc5e664d03409013bf
This commit is contained in:
Luciano Lo Giudice 2021-10-12 14:53:32 -03:00
parent 0f1134a7b3
commit a79f8d22c2
7 changed files with 10 additions and 11 deletions

View File

@ -1,5 +1,5 @@
- project:
templates:
- python35-charm-jobs
- python36-charm-jobs
- openstack-python3-ussuri-jobs
- openstack-cover-jobs

View File

@ -9,6 +9,7 @@
setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85
# Build requirements
cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35.
charm-tools==2.8.3
simplejson

View File

@ -50,8 +50,10 @@ host will never be overwritten.
## Deployment
To deploy, add a relation to the cinder charm:
Specify a block device (here we choose `/dev/sdb`) and then add a relation to
the cinder charm:
juju deploy --config block-device=sdb cinder-lvm
juju add-relation cinder-lvm:storage-backend cinder:storage-backend
# Documentation

View File

@ -102,7 +102,7 @@ options:
Volume group name to use within LVM. If empty, the volume group name
will be constructed by concatenating the 'alias' config option to the
prefix 'cinder-volumes-'.
backend-name:
volume-backend-name:
type: string
default:
description: |

View File

@ -63,7 +63,7 @@ def get_backend_name():
hostname = socket.gethostname()
alias = ch_hookenv.config('alias')
unique_backend = ch_hookenv.config('unique-backend')
backend_name = ch_hookenv.config('backend-name')
backend_name = ch_hookenv.config('volume-backend-name')
if backend_name:
pass

View File

@ -55,11 +55,6 @@ basepython = python3
deps = -r{toxinidir}/test-requirements.txt
commands = stestr run --slowest {posargs}
[testenv:py35]
basepython = python3.5
deps = -r{toxinidir}/test-requirements.txt
commands = stestr run --slowest {posargs}
[testenv:py36]
basepython = python3.6
deps = -r{toxinidir}/test-requirements.txt

View File

@ -207,9 +207,10 @@ class TestCinderLVMCharm(test_utils.PatchHelper):
self.assertNotIn('a', list(x[0] for x in config))
def test_cinder_vg_and_backend(self):
base = {'volume-group': 'test-vg', 'backend-name': 'test-bn'}
base = {'volume-group': 'test-vg', 'volume-backend-name': 'test-bn'}
self._patch_config_and_charm(base)
self.assertEqual(cinder_lvm.get_backend_name(), base['backend-name'])
self.assertEqual(cinder_lvm.get_backend_name(),
base['volume-backend-name'])
self.assertEqual(cinder_lvm.get_volume_group_name(),
base['volume-group'])