diff --git a/Makefile b/Makefile index 8156b37..229696f 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ build: clean LAYER_PATH=$(LAYER_PATH) tox -e build lint: - @tox -e lint + @tox -e pep8 test: @echo Starting unit tests... diff --git a/README.md b/README.md index fd223a9..f90840c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Barbican Source Charm +THIS CHARM IS FOR EXPERIMENTAL USE AT PRESENT. + This repository is for the reactive, layered, [Barbican](https://wiki.openstack.org/wiki/Barbican) _source_ charm. From the [wiki](https://wiki.openstack.org/wiki/Barbican) 'Barbican is a REST API @@ -11,7 +13,7 @@ for all environments, including large ephemeral Clouds.' The Barbican charm currently supports the following plugins: - - [charm-barbican-softhsm-plugin](https://github.com/openstack/charm-barbican-softhsm-plugin) + - charm-barbican-softhsm # Creating the primary MKEK and primary HMAC @@ -55,10 +57,10 @@ HSM may reject setting up the keys more than once. # Developer Notes The Barbican charm has to be able to set `[crypto]` and `[xxx_plugin]` sections -in the `barbican-api.conf` file. This data comes via the `barbican-hsm-plugin` +in the `barbican-api.conf` file. This data comes via the `barbican-hsm` interface from a charm (probably a subordinate) that provides the interface. -On the `barbican-hsm-interface` the data is provided in the `plugin_data()` +On the `barbican-hsm` interface the data is provided in the `plugin_data()` method of the interface (or if it is adapted) in the `plugin_data` property. The theory of operation for the crypto plugin is that a local library that diff --git a/src/layer.yaml b/src/layer.yaml index 38ca019..f7594c4 100644 --- a/src/layer.yaml +++ b/src/layer.yaml @@ -3,7 +3,7 @@ includes: - interface:mysql-shared - interface:rabbitmq - interface:keystone - - interface:barbican-hsm-plugin + - interface:barbican-hsm options: basic: use_venv: True diff --git a/src/metadata.yaml b/src/metadata.yaml index 310ef64..4006af1 100644 --- a/src/metadata.yaml +++ b/src/metadata.yaml @@ -19,5 +19,5 @@ requires: identity-service: interface: keystone hsm: - interface: barbican-hsm-plugin + interface: barbican-hsm optional: true diff --git a/tox.ini b/tox.ini index 41a21b7..c59e708 100644 --- a/tox.ini +++ b/tox.ini @@ -32,7 +32,7 @@ basepython = python3.5 deps = -r{toxinidir}/test-requirements.txt commands = ostestr {posargs} -[testenv:lint] +[testenv:pep8] basepython = python2.7 deps = -r{toxinidir}/test-requirements.txt commands = flake8 {posargs} src unit_tests diff --git a/unit_tests/test_lib_charm_openstack_barbican.py b/unit_tests/test_lib_charm_openstack_barbican.py index 2d9f381..83dc917 100644 --- a/unit_tests/test_lib_charm_openstack_barbican.py +++ b/unit_tests/test_lib_charm_openstack_barbican.py @@ -129,6 +129,7 @@ class TestBarbicanAdapters(Helper): 'os-internal-hostname': 'internal', 'os-admin-hostname': 'admin', } + def cf(key=None): if key is not None: return reply[key] @@ -169,6 +170,7 @@ class TestBarbicanCharm(Helper): 'mkek-key-length': 5, 'label-mkek': 'the-label' } + def cf(key=None): if key is not None: return config[key] @@ -192,6 +194,7 @@ class TestBarbicanCharm(Helper): self.log.assert_called_once_with( "barbican-mangage hsm gen_mkek succeeded") # and check that a problem is logged if it goes wrong + def side_effect(): raise barbican.subprocess.CalledProcessError @@ -214,6 +217,7 @@ class TestBarbicanCharm(Helper): 'hmac-key-length': 5, 'label-hmac': 'the-label' } + def cf(key=None): if key is not None: return config[key] @@ -237,6 +241,7 @@ class TestBarbicanCharm(Helper): self.log.assert_called_once_with( "barbican-mangage hsm gen_hmac succeeded") # and check that a problem is logged if it goes wrong + def side_effect(): raise barbican.subprocess.CalledProcessError