From 28196bc4d64cd4679446cc8688a28bfca3c6057c Mon Sep 17 00:00:00 2001 From: Dragomir Penev <6687393+dragomirp@users.noreply.github.com> Date: Mon, 23 Jan 2023 13:14:03 +0200 Subject: [PATCH] Updating libjuju to latest version for 2 (#53) * Unpinning libjuju * Update pinned flake8 version * Test tweak * Pinning juju 2.9.38.1 * Tweaking CSR check --- lib/charms/postgresql_k8s/v0/postgresql_tls.py | 8 ++++---- requirements.txt | 2 +- tox.ini | 18 +++++++++--------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/charms/postgresql_k8s/v0/postgresql_tls.py b/lib/charms/postgresql_k8s/v0/postgresql_tls.py index 7b00bf8283..46eba5aca6 100644 --- a/lib/charms/postgresql_k8s/v0/postgresql_tls.py +++ b/lib/charms/postgresql_k8s/v0/postgresql_tls.py @@ -45,7 +45,7 @@ # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version. -LIBPATCH = 4 +LIBPATCH = 5 logger = logging.getLogger(__name__) SCOPE = "unit" @@ -125,8 +125,8 @@ def _on_tls_relation_broken(self, _) -> None: def _on_certificate_available(self, event: CertificateAvailableEvent) -> None: """Enable TLS when TLS certificate available.""" - if event.certificate_signing_request != self.charm.get_secret(SCOPE, "csr"): - logger.error("An unknown certificate expiring.") + if event.certificate_signing_request.strip() != self.charm.get_secret(SCOPE, "csr").strip(): + logger.error("An unknown certificate available.") return self.charm.set_secret( @@ -144,7 +144,7 @@ def _on_certificate_available(self, event: CertificateAvailableEvent) -> None: def _on_certificate_expiring(self, event: CertificateExpiringEvent) -> None: """Request the new certificate when old certificate is expiring.""" - if event.certificate != self.charm.get_secret(SCOPE, "cert"): + if event.certificate.strip() != self.charm.get_secret(SCOPE, "cert").strip(): logger.error("An unknown certificate expiring.") return diff --git a/requirements.txt b/requirements.txt index 476e0c1539..5d71ef95fd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ cryptography==37.0.4 -ops==1.5.0 +ops==1.5.4 pgconnstr==1.0.1 requests==2.28.1 tenacity==8.0.1 diff --git a/tox.ini b/tox.ini index e88e54ec21..8eab0e4bf7 100644 --- a/tox.ini +++ b/tox.ini @@ -35,7 +35,7 @@ commands = description = Check code against coding style standards deps = black - flake8==4.0.1 # flake8 version 5.0.0 & 5.0.1 has issues with flake8.options.config + flake8==5.0.4 # https://github.com/savoirfairelinux/flake8-copyright/issues/19 flake8-docstrings flake8-copyright flake8-builtins @@ -71,7 +71,7 @@ commands = description = Run charm integration tests deps = pytest - juju==2.9.11 # juju 3.0.0 has issues with retrieving action results + juju~=2.9.0 # Latest juju 2 landscape-api-py3 mailmanclient pytest-operator @@ -90,7 +90,7 @@ allowlist_externals = description = Run database relation integration tests deps = pytest - juju==2.9.11 # juju 3.0.0 has issues with retrieving action results + juju~=2.9.0 # Latest juju 2 landscape-api-py3 mailmanclient pytest-operator @@ -109,7 +109,7 @@ allowlist_externals = description = Run db relation integration tests deps = pytest - juju==2.9.11 # juju 3.0.0 has issues with retrieving action results + juju~=2.9.0 # Latest juju 2 landscape-api-py3 mailmanclient pytest-operator @@ -128,7 +128,7 @@ allowlist_externals = description = Run db-admin relation integration tests deps = pytest - juju==2.9.11 # juju 3.0.0 has issues with retrieving action results + juju~=2.9.0 # Latest juju 2 landscape-api-py3 mailmanclient pytest-operator @@ -147,7 +147,7 @@ allowlist_externals = description = Run high availability self healing integration tests deps = pytest - juju==2.9.11 # juju 3.0.0 has issues with retrieving action results + juju~=2.9.0 # Latest juju 2 landscape-api-py3 mailmanclient pytest-operator @@ -166,7 +166,7 @@ allowlist_externals = description = Run password rotation integration tests deps = pytest - juju==2.9.11 # juju 3.0.0 has issues with retrieving action results + juju~=2.9.0 # Latest juju 2 landscape-api-py3 mailmanclient pytest-operator @@ -185,7 +185,7 @@ allowlist_externals = description = Run TLS integration tests deps = pytest - juju==2.9.11 # juju 3.0.0 has issues with retrieving action results + juju~=2.9.0 # Latest juju 2 landscape-api-py3 mailmanclient pytest-operator @@ -204,7 +204,7 @@ allowlist_externals = description = Run all integration tests deps = pytest - juju==2.9.11 # juju 3.0.0 has issues with retrieving action results + juju~=2.9.0 # Latest juju 2 landscape-api-py3 mailmanclient pytest-operator