Commit Graph

7 Commits

Author SHA1 Message Date
Hervé Beraud ab1d7e94a1 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: I609298d09de3806636b8a157f4ef81c1ab567bf7
2021-12-15 09:35:05 +00:00
Gustavo Sanchez 4d80c34b81
Fix keystone authentication
Changes project_domain_id and user_domain_id to *_name in manila.conf

Add defensive mechanism to fallback to `_id` if `_name` is not set

Closes-Bug: #1911424
Change-Id: I6240b7b7e4590a21f034b9c70247e87ec18d867d
2021-09-02 10:39:02 -04:00
Hervé Beraud f7b2b0a1fd 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: I5f0224f85939cf3fe86cf14d950dae0e2e1db869
2020-06-02 19:56:10 +02:00
wangqiangbj 430131afe6 fix misspelling of 'password'
Change-Id: Ie27d4c969558c6dbeb70004d48d8083807a68325
2018-01-25 19:33:21 +08:00
Alex Kavanagh add9a17cef 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: I74b737f3beb9ec89a963d65454190689c04cd9d1
Related-Bug: #1693017
Depends-On: I5ac40617ee30e5f421ec16fc7592177a5e6aa166
2017-05-25 10:21:57 +01:00
Alex Kavanagh 480f5051f0 Update manila-generic configuration charm for updated plugin i/f
The manila-plugin interface has been changed to simplify how backend
configuration charms can generate their config for the manila.conf file
in the manila principal charm.  This change enables the use of a
template/Jinja2 templating which simplifies the charm.

Change-Id: Id5e909ae352d73239354002abc62e9491c9a42b7
Depends-On: I76866007e3c89bb16bc7985a692fbd8f3e136a71
2017-02-17 10:34:35 +00:00
Alex Kavanagh 9b039d3981 First commit of charm-manila-generic
The generic manila charm provides the generic backend NFS configuration
for the manila file service charm (charm-manila).  This is the first
commit of code, and the CI tests have been disabled to enable it to
land.  This is because of a circular dependency with the manila charm
which requires this charm to be able to configure at least one backend.

This patchset is dependent on the interface-manila-plugin interface and
an updated version of charms.openstack that provides the 'options'
member: these are declared below.

Change-Id: I052f272dcd310091d988afd7104dea68115053ac
Depends-On: Ied0ad014ab7b1d4778113b0d3f2bbae08075372e
Depends-On: If6d103b4f62c95b0fa76562a18e418e0d319e987
2016-12-02 13:50:46 +00:00