Commit Graph

20 Commits

Author SHA1 Message Date
Hervé Beraud d746757302 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: If1ef6178116ed8f1ce8f0244d72246292cdf52e9
2021-12-15 10:07:32 +00:00
Billy Olsen 1bb6e20b34 Handle AddrFormatError when CIDR can't be found
The network space for the cluster space or the public space may have
addresses in a different subnet than the one that is currently assigned
to the unit. In this case, the attempt to look up the netmask results in
a value of None, which in turn causes charmhelpers to raise an
AddrFormatError when attempting to determine the CIDR.

Handle this case within the interface and return None for the respective
CIDR. This may cause some issues where the public or cluster CIDRs are
not resolvable, however the charm interface already expects to provide
None if the CIDR cannot be determined.

A better, however more invasive, change would be to change out the calls
in the ceph-mon charm to use the network_get calls rather than
network_get_primary_address. Per the documentation for the network
primitives, it appears that the cidr can still be empty and is likely to
still lead to the inability to resolve the CIDR locally.

This change will primarily focus on handling the inability to resolve a
CIDR locally, postponing the network_get transformation this late in the
cycle.

Closes-Bug: #1898299
Change-Id: If1538eb645577653cada770211fd445b76284fd3
2021-04-01 11:10:53 -07:00
Frode Nordahl 61c94148d9
Add support for handling of forwarded broker requests
Change-Id: I0d4ed457e1d59eabed3340f5dc7d8353d5d66f04
2020-11-06 10:11:09 +01:00
inspurericzhang 7627eb2e85 Switch to Ussuri jobs
Change-Id: Idb4befc0c7d2094ce0ab5d1306e41282a372d3de
2019-10-31 17:45:29 +08:00
Camille Rodriguez af7843edeb 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: I4af6d2c70c17f42c76bebbef05e259ae0ca3eeee
2019-08-27 08:41:54 -04:00
Corey Bryant 5e6c11fbc5 Add Python 3 Train unit tests
This is a mechanically generated patch to ensure unit testing is in place
for all of the Tested Runtimes for Train.

See the Train python3-updates goal document for details:
https://governance.openstack.org/tc/goals/train/python3-updates.html

Note that python35-charm-jobs is retained since this charm is supported
on Xenial.

Change-Id: Ie38f53298dd4f9001fa59f5a10c4cc42f55155cc
Story: #2005924
Task: #34228
2019-07-30 10:16:01 -04:00
OpenDev Sysadmins b454fa24b9 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:36:15 +00:00
Frode Nordahl 2e45c2b79b Handle calls with no relations
In some situations the charm will call out to us thinking it has
relations when it has not.

Change-Id: If96f1501892784d7addedbbd7eca55dc8e7bb9ba
Closes-Bug: #1822102
2019-03-28 14:20:03 +01:00
Frode Nordahl 2677eb3a2f Add ``public_network`` and ``cluster_network`` properties
Change-Id: Ia49f4921e772376763be178e11d7777676ccc8da
2019-03-06 15:24:45 +01:00
Frode Nordahl e7fb14440e Add ``refresh_pools``
Change-Id: I97bfb9a2c0e30998566aee56d4630af6baa36d45
2019-03-06 15:24:11 +01:00
Frode Nordahl 65415824d0
Avoid duplicate ``create-pool`` requests for same pool
Change-Id: I801843f81d5fbe9838142b8fba96d93bbdfc91e4
2019-03-06 15:20:37 +01:00
Frode Nordahl 6a9d50c2dc
Add gate jobs
Add test coverage report

Change-Id: I6206237d1cc902a1e8e521b37c19d84267ae8d6d
2019-03-04 08:04:35 +01:00
Frode Nordahl 08f25a7862
Add function to create erasure coded pools
Rename the existing one to ``create_replicated_pool`` for clarity.
2019-02-28 09:09:50 +01:00
Frode Nordahl bced80a856
Fix ``mon_hosts`` unit test 2019-02-26 12:23:02 +01:00
Frode Nordahl 9f6570e970
Make ``mon_hosts`` a function and not a property 2019-02-26 11:59:00 +01:00
Frode Nordahl b54d497d91 Add pool creation, fix individual key naming
Adds a pool creation function that works with Endpoint based interfaces.
2019-02-25 13:46:00 +03:00
Frode Nordahl b2ab9c6bcf Add ``key`` property 2019-02-25 13:45:51 +03:00
Frode Nordahl 650a3947cd
Merge pull request #1 from openstack-charmers/fix-travis-test-matrix
Fix Travis test matrix
2019-02-06 10:04:47 +01:00
Frode Nordahl 2407e9ec24
Fix Travis test matrix 2019-02-06 10:01:43 +01:00
Frode Nordahl d515ede351
Add ``ceph-rbd-mirror`` interface 2019-02-06 09:58:45 +01:00