Commit Graph

22 Commits

Author SHA1 Message Date
Hervé Beraud f90f8c6edc 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: I69e03a14ab370bd6870e4325627e7be86fe2a53f
2021-12-15 10:09:45 +00:00
David Ames 06675c43c9 Scale-in fixes
Properly handle departed and broken hooks.

Change-Id: Iecb1f943ffa5505617b5e5eb70f070458fc6645d
Closes-Bug: #1881596
2020-08-28 09:35:21 -07:00
David Ames b2ed9aa73c Enable MySQL TLS
Enable passing the certificate authority on the relation in order to
enable TLS communication to the MySQL DB.

In order to enable MySQL to use TLS for client connections all that
is required is the CA certificate. A certificate and key may be used
for client certificate authentication. However, since almost all
deployments will not use certificate authentication, focusing on the CA as SSL
data complete makes sense.

Change-Id: I785afe7f64cb57caa857178d529e3cabdcf63517
2020-06-30 15:24:52 -07:00
David Ames c31027400a Specify the port for Shared DB connections
Prior to this change there was no way to specify a port for mysql
connections. Add this to the Shared DB connection information.

Change-Id: Iafcc106fca44479e89b4b66a0a3988ffeee01f04
Closes-Bug: #1876188
2020-05-04 15:42:15 -07:00
David Ames 7c50d9e1dc Pass wait timeout all the way through to clients
Pass the non-interactive wait timeout value through.

Change-Id: I25c2e982ebabe09385e52fef0fb8c97cabe60756
Closes-Bug: #1841063
2020-04-17 07:38:48 -07:00
Liam Young 1099a6b3ec Ensure unit acl before raising 'available' state
Check the allowed_units list past back by the db before raising the
'available' state to ensure charms do not try to connect to the db
before they are allowed.

Change-Id: I17228ba5d82249f0a5baffab1c2d200963b55b10
Closes-Bug: #1861665
2020-02-03 10:54:44 +00:00
Liam Young 6c1b8d4192 Remove DB available states if maintenance mode
If the DB is in maintance mode then remove the 'availble' states
to let the charms now the db cannot be accessed.

Depends-On: I5d8ed7d3935db5568c50f8d585e37a4d0cc6914f
Change-Id: If31eaad0b781d4250524335377152f3bd140f57b
2020-01-30 19:40:21 +00:00
inspurericzhang ceaffa0af6 Switch to Ussuri jobs
Change-Id: I180afc0040e49a1a3b5c6135369f13b717773764
2019-10-31 17:56:19 +08:00
Zuul 70b6d047fa Merge "Shared-DB Provides" 2019-10-03 16:29:43 +00:00
David Ames 9cc097f06e Shared-DB Provides
Enable the provides side of the interface with an Endpoint
implementation.

Change-Id: If218a23445709543426de0501765ed24eb8af308
2019-10-03 07:54:03 -07:00
Camille Rodriguez f2244c7367 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: I4af06dff68ecb5c74e6af0a94a7a3a678c632f13
2019-08-27 09:03:54 -04:00
OpenDev Sysadmins 1772dedc55 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:47:52 +00:00
Zuul 29bf2cb5cb Merge "Add py36 tox environment" 2018-12-11 14:11:17 +00:00
David Ames efa7cb3d5a Check if any HA units remain on departed
If there are still HA units in the relation when a single unit departs
re-evaluate state. If it is the last unit, unset all relation states.

Handle the case juju remove-relation and juju add-relation.

Change-Id: I92909d6203fc00d45d7d6edf0a981f9d759add53
Partial-Bug: #1800730
2018-11-16 14:04:55 -08:00
wanghui b645c7aff0 Add py36 tox environment
Change-Id: I6aad1ab6bba285826ef600436ebff20d2d78ad60
2018-11-07 20:22:48 +08:00
Zuul 59f2822e9c Merge "fix tox python3 overrides" 2018-10-12 10:49:05 +00:00
Doug Hellmann e88f2bea23 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

Change-Id: I381d41bafff73e8071776ffea21b161884fb2d7d
Story: #2002586
Task: #24317
2018-10-04 12:43:34 +00:00
Doug Hellmann 8c248500ea 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: I968633e7c1df794202b9a524b314e58af7765ab8
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-10-04 12:43:29 +00:00
Andreas Jaeger 7357e293a2 Update tox to remove deprecated pip option
The job --allow-unverified is obsolete, also python-apt cannot be
installed and is unneeded for current jobs.

Remove so that python installation works.

Change-Id: If78580407a9ed6498853101982bd67cac82b7069
2018-10-04 12:18:00 +02:00
James Page 7b9fc4e9aa Automatically set hostname relation data
Instead of relying on the user of the interface to set the correct
hostname parameter when configuring database access request,
automatically determine the correct hostname using:

 1) In Juju >= 2.0, using the network space binding of the
    named relation.
 2) In Juju < 2.0, using the units private-address.

The hostname relation value can be overridden using the hostname
parameter of the configure method.

Change-Id: Id69a3786d2ac754aa8659b8cde977c4d86a37fc8
2017-01-25 10:47:19 +00:00
James Page 7587a4b6e8 Add support for verification process
Add required configuration files and generally update the interface
after move to OpenStack git/gerrit.

Change-Id: If80a3393d566953c3349c74e62b860b582961769
2016-07-07 15:39:05 +01:00
Corey Bryant 79c265c408 Initial commit 2015-11-30 15:33:53 +00:00