The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.
Note that https://github.com/openstack/charms.openstack is used during tests
and he need `mock`, unfortunatelly it doesn't declare `mock` in its
requirements so it retrieve mock from other charm project (cross dependency).
So we depend on charms.openstack first and when
Ib1ed5b598a52375e29e247db9ab4786df5b6d142 will be merged then CI
will pass without errors.
Depends-On: Ib1ed5b598a52375e29e247db9ab4786df5b6d142
Change-Id: I2570caf6f292b2dd152f7c229be6651978f80bff
The existing comment in the code expresses the correct intent:
"fetch current secret-id, if any, from relation with barbican principle"
but then attempts to retrieve the secret-id from the vault
relation.
Change-Id: Ie2694ba38e08fd9e864bf9d8fa0b63f0e185b8bd
Closes-Bug: #1871981
Pin the version of hvac for a consistent response type. Use the adpater
to get response code and json data.
Closes Bug: #1871981
Change-Id: Ia8517a75e7bc20f751eca83aaa84728cc62edee6
The hvac.Client post response is no longer an object with status_code and json
encoded data. It is a dictionary.
Change-Id: I1cacc8deda005cdbb2290d5ae821e4870608a41a
Since the relation with vault maybe contain more than one
token and we have no way to know if they are valid, we
support trying them all until we get a good one and raise
the error only if we tried them all unsuccessfully and
have no current secret-id otherwise return current
secret-id.
Change-Id: I2ee5ffe5d53e874efb3fabc6a880bf95b00a44f9
Partial-Bug: #1849323