Skip to content

chore: test #1111 #1251

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

Closed
wants to merge 2 commits into from
Closed
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
9 changes: 9 additions & 0 deletions juju/client/facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,10 @@ async def rpc(self, msg: dict[str, _RichJson]) -> _Json:
@classmethod
def from_json(cls, data: Type | str | dict[str, Any] | list[Any]) -> Self | None:
def _parse_nested_list_entry(expr, result_dict):
# FIXME if no client uses this data, can we drop this?
if isinstance(expr, str):
# FIXME no top-level use
raise Exception(f"Ouch {expr=}")
if ">" in expr or ">=" in expr:
# something like juju >= 2.9.31
i = expr.index(">")
Expand All @@ -694,9 +697,15 @@ def _parse_nested_list_entry(expr, result_dict):
# this is a simple entry
result_dict[expr] = ""
elif isinstance(expr, dict):
# FIXME no top-level use
raise Exception(f"Ouch {expr=}")
for v in expr.values():
_parse_nested_list_entry(v, result_dict)
elif isinstance(expr, list):
# FIXME test vectors from quarantined integration tests
# expr=['juju', {'any-of': [{'all-of': ['juju >= 2.9.49', 'juju < 3']}, {'all-of': ['juju >= 3.4.3', 'juju < 3.5']}, {'all-of': ['juju >= 3.5.1', 'juju < 4']}]}]
# expr=['juju', {'any-of': [{'all-of': ['juju >= 2.9.44', 'juju < 3']}, {'all-of': ['juju >= 3.4.3', 'juju < 4']}]}]
# expr=['juju', {'any-of': [{'all-of': ['juju >= 2.9.44', 'juju < 3']}, {'all-of': ['juju >= 3.4.3', 'juju < 4']}]}]
for v in expr:
_parse_nested_list_entry(v, result_dict)
else:
Expand Down
Loading