Commit Graph

12 Commits

Author SHA1 Message Date
Adam Dyess d9f3b53ca0 implement reactive.Endpoint.manage_flags to clear flags on departed hook
Change-Id: Ie2e6d8ec460311fa4e63335f322aaae07dca5842
2022-11-28 16:06:12 -06:00
Frode Nordahl b143db91de Allow passing keyword arguments to create_*_pool
The CephBrokerRq class will be used to validate the arguments
passed so that the caller will get immediate feedback if any
unknown arguments or invalid values are used.

Change-Id: Ideb142ead729977dedd2c00435e98846fc842da3
2020-10-02 09:15:50 +02:00
James Page f86d2614b4 Use properties correctly
Its not possible to call a method which is annotated as a property
so which to just using the property directly.

Its also difficult to patch a property during unit testing so
provide private methods for unit testing to allow properties
to be specified during testing.

Change-Id: Id9db6578e00fa412e4cf58e75bd89970b6e8e682
2020-08-27 10:04:09 +01:00
Liam Young fc168f4e7b Switch requires from RelationBase to Endpoint
Switch requires relation from the old api
charms.reactive.relations.RelationBase to the replacement
charms.reactive.endpoints.Endpoint.

Change-Id: I6fe7cab654d5768f521ffa4218ae5c3974ef4ae8
2020-08-17 08:16:55 +00:00
Liam Young cd3626b047 Re-organise interface
Re-organise interface to allow multiple interfaces to share
common code. The idea being to add ceph-mds to this code base.

Change-Id: Ie53ef7e5fc7a461dca8e53d9f91b332399a70076
2020-08-17 08:14:43 +00:00
Liam Young ba731e355c Re-enable unit tests
Re-enable and fix unit tests. Unit test check of set_local removed
as the json dump is not ordering dict keys and the set_local
calls will be removed by an imminent patch.

Change-Id: Id804e0e518c0013043db6f4b7cd44ccaa5499749
2020-08-14 07:53:53 +00:00
Hervé Beraud d90df3e9d2 Use unittest.mock instead of mock
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.

Change-Id: I887adac6caebb327871d3709ed59f25e401b5600
2020-06-08 22:44:28 +02:00
Zuul 7765bcf1b3 Merge "Revert "Refactor create_pool." and "Add request_access_to_group method"" 2019-02-28 15:41:48 +00:00
Chris MacNaughton (icey) a39dd3b9da Revert "Refactor create_pool." and "Add request_access_to_group method"
This reverts commit e4997e5ab8 and
288bab66dd.

This is necessary as this change does not verify that there is not an
existing request to do this in the queue, and will end up creating
infinite create_pool requests on the ceph-mon

Change-Id: I76305181ddba83eca414d9e08bbd58408d2b01ce
2019-02-28 16:18:40 +01:00
Liam Young 288bab66dd Add request_access_to_group method
Add request_access_to_group method to allow a client to request
ceph permissions.

Change-Id: I8a7f0bf47c39509eec71a286bd51ec53c58d7e0d
2019-01-08 14:00:13 +00:00
Liam Young e4997e5ab8 Refactor create_pool.
Refactor create_pool to allow future methods to easily access
the existing request. This change also includes two changes in
behaviour:

 * If an existing request is invalid due to invalid json or missing
   ops attribute then the exception is now propagated rather than
   logged and suppressed. If an existing request is corrupt then
   fail early otherwise bad things will follow.
 * The existing implementation only allows for a single create_pool
   request. Any additional requests would overwrite previous ones.
   This change allows for multiple pools to be requested in a
   single broker request.

Change-Id: I61998c2ce70325cb904add8c51cbc9c34b3c9564
2019-01-08 11:33:03 +00:00
Liam Young e43d82e1f8 Add unit tests
Interface can now have unit tests so I have added them.

Change-Id: I6fba1ae6cb428c7f73446d051bf05657aba57ba2
2018-12-07 19:54:10 +00:00