Commit Graph

21 Commits

Author SHA1 Message Date
Alex Kavanagh d0ad23950f Fix local/remote assumptions in manila charm
When the remote plugin was developed it made the assumption that the
`enabled_share_backends` included the remote backends. This assumption
is wrong, and it should only contain the locally defined drivers; i.e.
ones that have a [driver] section in the manila.conf file. The cephfsnfs
driver doesn't have a local configuration as the share-server is runs on
the manila-ganesha unit and so shouldn't be local.

This patch splits the config in local/remote and then uses the local and
remote config in the correct places.

Closes-Bug: #2012457
Change-Id: I436452208aaeaf08d1655da4fccbd7a89549b404
2023-09-29 09:52:46 +01:00
Chris MacNaughton eb6437174a Ensure that local and remote plugins can be used concurrently
To ensure that it works, this change also updates the functional
test bundles to include manila-netapp and manila-netapp-dhss in
the gate.

This change also picks up a drive-by change to fix a tox
dependency change.

Closes-Bug: #1996962
Change-Id: Ic5a2b2fcced129220b70a16539b41813b0feb3be
2023-02-24 09:50:26 -05:00
Corey Bryant 10524b6ed3 Build separately for each supported series and use binary builds
Charms for OpenStack Yoga supports both Ubuntu Focal and Jammy
which means Python 3.8 and Python 3.10.  Managing dependencies
across those two versions is non-trivial and we need to build
the charm on the series the charm is supposed to support.

Switch to using a binary build which allows pip's dependency
resolution to work.

This patch also updates manila.py to align with
charm-interface-keystone commit
9ad5cade97e14b672ac859d34040353c3a40c7aa.

This patch also drops the impish bundle.

Change-Id: Ib3aea3fb26aa3e6282989b2758bdf4913ef58c28
2022-10-04 00:20:22 +00:00
Hervé Beraud 0c1b1f1a50 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.

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: I38b8a9d40577e97bf7c5e73630fc044c3356c902
2021-12-15 09:45:22 +00:00
Zuul b75e6ed3ce Merge "Adds NRPE checks for services" 2021-09-09 13:32:53 +00:00
Gustavo Sanchez 88def9dcea
Adds NRPE checks for services
Adds the nrpe-external-master layer and checks for services managed by
this charm.

func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/624

Closes-Bug: #1925977
Change-Id: I2536e0b95d9b7568e8c20b6f6eedc2c92eca0603
2021-09-09 02:03:05 -04:00
Gustavo Sanchez 310647c2bd
Fixes flacky unit test wih py36
When running TestManilaCharm.test_install() with py36 sometimes
test passes and sometimes throws and error while mocking methods.
Seems to be an async race problem mocking a super method first.

This was solved by avoiding mocking super method first.

Closes-Bug: #1940552
Change-Id: Iac55321599b4866784a0631639a93fc828780647
2021-08-20 11:12:55 -04:00
Ionut Balutoiu 37819cd9f3 Fix multi-backend configuration
At the moment, the enabled backends' names list is written in the config file
as a space-separated list.

When using multi-backend, the current Manila charm crashes because the config
`enabled_share_backends` needs to a comma-separated list of backend names instead:
https://docs.openstack.org/manila/victoria/admin/shared-file-systems-multi-backend.html

Change-Id: I881d12ad4cea044e232b9f997a4dfc4b2f38e9c8
2021-03-17 08:38:02 +00:00
Billy Olsen 9f22f1d0dd Ensure that endpoints are updated when tls config changes
When tls settings change, the endpoints need to be updated on the
identity-service relation in order for keystone to update the service
catalog with the new endpoints. This change follows the behavior of
other reactive charms and performs this update within the handlers
code.

Func-Test-Pr: https://github.com/openstack-charmers/zaza/pull/424
Change-Id: I201fc382f044111e6f28a13c64a55e2f79c1d6aa
Closes-Bug: #1901589
2021-02-19 15:33:59 +01:00
Hervé Beraud 9015785f01 Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: Ia065d209d91046d67081ec528b275db9d0ece592
2020-06-02 19:55:36 +02:00
Chris MacNaughton 4f5c6a9712 Enable HA with Manila
An indirect requirement of enabling HA with Manila
is migrating from directly using WSGI to using
mod-wsgi with Apache.

Change-Id: I1f501283db3db1338d47a89a7688cf5035d08a7a
Closes-Bug: #1867358
2020-04-01 15:20:05 +02:00
Chris MacNaughton 4480456e15 Add new remote-manila-plugin interface
This change adds the new interface remote-manila-plugin
which is treated in the same way as the existing
manila-plugin interface, except that the remote version
will disable the manila-share service

Change-Id: I28a56a7ea4cb9679b6000a6e22a6e938eed8551f
2019-11-07 19:57:45 +08:00
David Ames 24661f21e5 Fix unit test
Change-Id: Ic296b07c7f01a4ddcd8abf16b284767611f977ae
2019-10-24 13:10:06 -07:00
Frode Nordahl 4204ea1976
Enable default certificates handler
Previously the default ``certificates.available`` handler was
enabled without the charm authors intervention, this was changed
in I12f45236632b608e07fdd35d31b90b84ca92eb1f.

Change-Id: Ifdf209d815963265594e5e469dbaac262f4ed749
2019-09-03 09:59:57 +02:00
Alex Kavanagh b902df7e0e Fix up to work with 0.6.0 of charms.reactive
charms.reactive deprecates the RelationBase.from_state() class
method.  This is an internal method in charms.reactive and shouldn't
really have been used.

This patch changes to charms.relations.endpoint_from_flag(...) which
essentially does the same thing and will be a more stable API moving
forwards.

Note that from this point on, the library will ONLY work with
charms.reactive 0.6.0 onwards and the modified charms.openstack library.

Change-Id: I6e025438bacd17dfb2a6f61fb8ca274187009c57
2018-01-18 15:20:19 +00:00
Alex Kavanagh df96346eb9 Enable worker-multiplier on manila
This change draws on the charms.openstack and layer-openstack-api
changes to provide the ability to configure the number of workers that
the manila charm starts for API usage.

It also:
 * Packages the manila charm into a venv.  This is because the
   subordinate charms are ALSO reactive, which means that different
   versions of either charms.reactive or charms.openstack could be
   overwritten from the subordinate charm.
 * Band-aid an issue with manila-share not being started even though all
   of the config is properly set.  This uses the update-status hook to
   check to see if the manila-share service should be running.
   (Bug: #1706699)
 * Work-around for a bug in python-manilaclient (Bug: #1707303) which
   caused basic_deployment test 400 to fail.

Change-Id: I0ea0f14fb69bea5d2008ed70d72ba27c98c96679
Depends-On: I3cea350e536306655f5f109ec67ae7f0fba35fda
Depends-On: Id4145ffaa622727523003015d7012ece2f0eae4f
Related-Bug: #1677543
Partial-Bug: #1706699
Related-Bug: #1707303
2017-08-10 12:41:42 +01:00
Alex Kavanagh 9ecbf06203 Use charms.openstack charmhelpers test_mocks
Every reactive charm that uses charms.openstack and implements unit
testing needs to mock charmhelpers, as otherwise the tests blow up.
This patch uses the mocking of charmhelpers in charms.openstack so that
a charm layer can just import test_mocks and charmhelpers will be mocked
out along with setting up a default
charmhelpers.c.o.u.OPENSTACK_RELEASES so that when an OpenStackCharm()
derived charm class won't fail on definition.

Change-Id: Ice9a21a4c10d3db8b0bcf607ce5418e624e4a38b
Related-Bug: #1693017
Depends-On: I5ac40617ee30e5f421ec16fc7592177a5e6aa166
2017-05-25 10:42:22 +01:00
Jenkins f42c981dff Merge "Update manila to support new interface for configuration" 2017-02-17 13:29:38 +00:00
Alex Kavanagh 417a70eb01 Update manila to support new interface for configuration
The manila-plugin interface is changed to make writing configuration
plugin charms easier to write.  This updates the manila charm to support
that interface.

Change-Id: I260ce1d1287a7127838198d5aefea64454de8d3c
Depends-On: I76866007e3c89bb16bc7985a692fbd8f3e136a71
2017-02-17 10:31:27 +00:00
James Page 93bd2065f7 Fix support for shared-db network spaces
Newer versions of the mysql-shared interface automatically configure
the hostname data item based on either the network space binding for
the relation (for Juju 2.0 and later), or using the units private-address
on older Juju versions.

Change-Id: I8b3e351b0cb475c9859181db03e63fd6365c844e
2017-01-26 11:56:03 +00:00
Alex Kavanagh 490cddccaa First commit of manila charm
This patchset contains the code/charm for a working manila fileshare
service. On its own, the fileshare the charm installs is not functional
as a backend is needed. The charm-manila-generic plugin charm is
provided separately to provide the generic NFS file share service.

This patchset also includes the amulet/bundle tests to test that the
charm installs the manila software and can get it running.  However, no
functional tests of the actual manila software are done.

This patchset is dependent on the interface-manila-plugin interface and
an updated version of charms.openstack that provides the 'options'
member. It also depends on a slight change to the
interface-neutron-plugin which adds a requires.py to allow it to be used
to plugin to principal charms: these are declared below.

Change-Id: Ie9bb7af1baab8b3bc20d26d907d9b51957eb326e
Depends-On: Ied0ad014ab7b1d4778113b0d3f2bbae08075372e
Depends-On: If6d103b4f62c95b0fa76562a18e418e0d319e987
Depends-On: I8760f2f9bec85ccc8b149b9560a6eed3e9ab418b
2016-12-02 13:50:04 +00:00