Skip to content

Commit

Permalink
remove workaround for juju bundle storage constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
addyess committed Oct 30, 2024
1 parent 7ae0e55 commit abf5387
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# workaround for juju == 3.5.0.0
# https://github.com/juju/python-libjuju/issues/1052
juju @ git+https://github.com/juju/python-libjuju.git@53cd33d884f3ca710e1fa026c74f31b02281be69
juju
pydantic<2
pylxd
pytest
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def switch(self, name: str, path: Path):
def drop_constraints(self):
"""Remove constraints on applications. Useful for testing on lxd."""
for app in self.applications.values():
app["constraints"] = None
app["constraints"] = ''

def add_constraints(self, constraints: Dict[str, str]):
"""Add constraints to applications.
Expand All @@ -193,7 +193,7 @@ def add_constraints(self, constraints: Dict[str, str]):
constraints: Mapping of constraints to add to applications.
"""
for app in self.applications.values():
val: str = app["constraints"]
val: str = app.get("constraints", "")
existing = dict(kv.split("=", 1) for kv in val.split())
existing.update(constraints)
app["constraints"] = " ".join(f"{k}={v}" for k, v in existing.items())
Expand Down

0 comments on commit abf5387

Please # to comment.