Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure the charm can be installed bionic #70

Merged
merged 4 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
charmhelpers
packaging
packaging < 22.0 # make sure this works on all [email protected], [email protected], and [email protected],
# pin ops framework version to
# support bionic deployments
ops >= 1.5.0,< 2.0.0
2 changes: 1 addition & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def get_controller_version(self) -> version.Version:
if not controller_version:
raise RuntimeError("Charm failed to fetch controller's version.")

return version.parse(controller_version)
return version.Version(controller_version)

def get_controller_ca_cert(self) -> str:
"""Get CA certificate used by targeted Juju controller.
Expand Down
4 changes: 2 additions & 2 deletions src/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def controller_endpoint(self) -> Union[str, List[str]]:
endpoints: Union[str, List[str]] = self.controller.split(",")
current_version = ExporterSnap.version()

if current_version <= version.parse("1.0.1"):
if current_version <= version.Version("1.0.1"):
if len(endpoints) > 1:
raise ExporterConfigError(
f"Currently installed version of exporter ({current_version}) does "
Expand Down Expand Up @@ -231,7 +231,7 @@ def version(cls) -> version.Version:
raise ExporterSnapError("Exporter snap is not installed.")

snap_version = snap_info["installed"].split()[0]
return version.parse(snap_version)
return version.Version(snap_version)

def restart(self) -> None:
"""Restart exporter service."""
Expand Down
3 changes: 0 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@ passenv =
TEST_*

[testenv:dev-environment]
envdir = {toxinidir}/.venv
deps =
pre-commit
{[testenv:lint]deps}
{[testenv:unit]deps}
{[testenv:func]deps}

[testenv:pre-commit]
envdir = {[testenv:dev-environment]envdir}
deps = {[testenv:dev-environment]deps} # ensure that dev-environment is installed
commands = pre-commit run --all-files

Expand All @@ -62,7 +60,6 @@ deps =
{[testenv:func]deps}

[testenv:reformat]
envdir = {toxworkdir}/lint
commands =
black .
isort .
Expand Down