Set options for KV backends

Ensure KV backend is created as a v2 backend by using
explicit provision of options when enabling the secret
backend.

Change-Id: Ief0a26c8a1adb9f6be39fa497222f809994c11d0
This commit is contained in:
James Page 2018-10-23 14:39:26 -06:00 committed by Frode Nordahl
parent f4bf636c87
commit 54a29e06ab
3 changed files with 5 additions and 3 deletions

View File

@ -327,7 +327,8 @@ def configure_secret_backend(client, name):
if '{}/'.format(name) not in client.list_secret_backends():
client.enable_secret_backend(backend_type='kv',
description='Charm created KV backend',
mount_point=name)
mount_point=name,
options={'version': 2})
def configure_policy(client, name, hcl):

View File

@ -57,4 +57,4 @@ commands = {posargs}
[flake8]
# E402 ignore necessary for path append before sys module import in actions
ignore = E402
ignore = E402,W504

View File

@ -342,7 +342,8 @@ class TestLibCharmVault(unit_tests.test_utils.CharmTestCase):
hvac_client.enable_secret_backend.assert_called_once_with(
backend_type='kv',
description=mock.ANY,
mount_point='test')
mount_point='test',
options={'version': 2})
def test_configure_secret_backend_noop(self):
hvac_client = mock.MagicMock()