Commit Graph

37 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
Liam Young 3ca251fb01 Send additional info to support CMR
Send application name and local unit name when talking to ceph.
This ensures that the response from ceph can be spotted by the
unit making the request.

This is already being done in the classic charms *1

*1 https://review.opendev.org/q/topic:%22bug%252F1780712%22+(status:open%20OR%20status:merged)

Change-Id: I0eb96ab8b1048bf209ffb011dd585af956ab779a
Closes-Bug: #1926667
2021-04-30 15:26:26 +00:00
Alex Kavanagh 72245e1d00 Switch from testr to stestr for unit tests
Change-Id: I2415dbae9c2a2ac5951b9e9176a514a1d1330ab0
2021-02-10 10:19:46 +00: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
Liam Young e92d8933b4 Support MDS clients requesting addional pools
Allow MDS clients to specify additional pools to be added to the
FS being created.

Also drive-by fixes to calls to self.send_request_if_needed

Change-Id: Ib19e545fc676fa9e986f3fddcfb92cf99e778a3f
2020-09-10 14:47:15 +00: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
James Page 22600e77f1 Markup properties
Ensure that various data items are available via the relation
adapters in charms.openstack by marking functions as properties.

This equates to the auto_accessors lists in the ceph-client and
ceph-mds RelationBase endpoint implementations.

Change-Id: I240552158475635d6996c622bf17eb6dd73b5d81
2020-08-26 13:13:18 +01:00
Liam Young 1f86962275 Add ceph-mds relation
This relation is very similar to the ceph-client relation so add
it to this repo so they can share code. This will retire the
seperate repo *1 and also require an update to the central
index of interfaces to point at the new location.

*1 https://github.com/openstack/charm-interface-ceph-mds
*2 https://juju.github.io/layer-index/

Change-Id: I9f438bb678da1b69d8161390aad2cf58907bc1b5
2020-08-17 08:20:34 +00: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
Zuul 35e3ade214 Merge "Add support for erasure coded pools" 2020-08-14 14:04:50 +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
James Page a8d8821d9e Add support for erasure coded pools
Add helpers to request erasure coding profile and pool creation.

Change-Id: I4512b9957722332fe0a311d09fedffb4d4e47fbd
2020-08-06 06:16:10 +01: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
James Page 462582e4f3 requires: Provide get_current_request method
Minor refactor to ensure that the get_current_request method
actually exists for the requires part of this interface.

Misc drive by fixes for CI scaffolding as well.

Change-Id: I26e9585df2a84c336d9f01115c6208d7ef994b3c
2020-05-04 10:19:09 +01:00
Chris MacNaughton 49f4a1279a Fix reference to request
Change-Id: I33eb1eaadc240e5e73c7548d62afb1ae6c6829d1
Closes-Bug: #1845941
2019-09-30 13:29:52 +02:00
Zuul 4df68414f1 Merge "Adding support for multiple ceph pool creation" 2019-09-24 12:23:18 +00:00
Mike Wilson d313ca64f4 Adding support for multiple ceph pool creation
Added create_replicated_pool to match the charm-helpers
deprecation of create_pool. I didn't make a
create_erasure_pool.

Piped create_pool through create_replicated_pool to
mirror charm-helpers.

create_replicated_pool can now be called multiple
times to create multiple pools

Related-Bug: #1824035
Change-Id: Iaa421ff152dc40bf446200cabc19d99f5b04bbe9
2019-09-17 17:20:20 +02:00
Camille Rodriguez 29eba49426 Avoid pollution and false positives with tox.ini
- removing sitepackages in tox.ini to avoid test env pollution
- skip_missing_interpreters in tox.ini set to False to avoid false
positives by skipping missing interpreters.

Change-Id: I72582997b86641c773686e4e04cedf7d1d11d9e1
2019-08-27 08:39:21 -04:00
OpenDev Sysadmins 8dd7042884 OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:28:22 +00: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
Chris MacNaughton 68c2d0ca1d update interface.yaml with ignores and maintainer
The ignores removes all files that are not relevant to
the interface from the built charm, and thus, the
runtime imports of the interface bits

Change-Id: I4d5c58fff7d05dc10eea54567fbabb579a9ddd71
2019-02-20 09:43:49 +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
Zuul 00e88139d8 Merge "Add unit tests" 2018-12-07 21:26:52 +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
Liam Young c90bca40da Expose all create pool options.
Expose all supported options in the create_pool interface method.

Change-Id: Ib497c7a797ca2d729ec2143209a8c273ea2d4704
2018-12-06 14:39:42 +00:00
Liam Young aec6677875 Support charm specifying weight on pool creation
When a charm requests a pool in cannot specify the weight atm as
the create_pool function forces it to None.

Change-Id: I40a85cf5c0e943aef0b4ec507d8c9b3a24ba09a8
2018-12-06 13:52:21 +00:00
Doug Hellmann 7cfed26220 fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: I2bc5f7d63ef948318a8c5c6c498021431f9757ad
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-10-04 12:35:37 +00:00
Doug Hellmann 8bc220e3d7 import zuul job settings from project-config
This is a mechanically generated patch to complete step 1 of moving
the zuul job settings out of project-config and into each project
repository.

Because there will be a separate patch on each branch, the branch
specifiers for branch-specific jobs have been removed.

Because this patch is generated by a script, there may be some
cosmetic changes to the layout of the YAML file(s) as the contents are
normalized.

See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html

Remove --allow-unverified from pip, it's not supported with current pip.
Remove install of python-apt since it fails and is unneeded for the job.

Change-Id: I72ab95ec19b059ef83e628859cf16e663333308b
Story: #2002586
Task: #24317
2018-10-04 12:02:22 +02:00
James Page 60d8255921 Add support for ceph-proxy dataset
Add parsing of munged data presented by the ceph-proxy
charm in the ceph-public-address relation key; this
includes dropping the addition of the port to the values
added to the list of monitor hosts - this is not required
and the ceph-proxy may provide that data as part of the
ceph-public-address.

This change brings this interface inline with existing
ceph context support in the openstack charm helpers.

Change-Id: Id4d7b5df711c378763d5adb54269a3ede344dd45
2017-09-26 08:07:11 +01:00
James Page 0e191799fc Add initial requires 2017-07-03 15:17:35 +01:00
Chris MacNaughton 35af1b8e9c do not need empty key 2016-05-26 16:43:12 -04:00
Chris MacNaughton bbcab3a548 clean comment 2016-05-25 11:48:06 -04:00
Chris MacNaughton 7c54fb4fda fix relation 2016-05-25 10:53:50 -04:00
Chris MacNaughton 837ef5c9c0 initial ceph-client commit 2016-05-24 14:30:49 -04:00