mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-05 15:35:06 +00:00
fix(remote): send the off form of a service --x/--no-x flag over --remote
This commit is contained in:
@@ -581,9 +581,13 @@ def find_remote_service(services: list[dict], name: str) -> dict | None:
|
||||
|
||||
|
||||
def remote_service_params(info: dict, data: dict[str, Any]) -> dict[str, Any]:
|
||||
"""The remote service's cli options in ``data``, read by ``service_options``."""
|
||||
names = {p.get("name") for p in info.get("cli_params") or [] if p.get("kind") == "option"}
|
||||
return {k: v for k, v in service_options(data, names).items() if v is not None and v is not False}
|
||||
"""The remote service's cli options in ``data``, without None, and without False for an option off by default."""
|
||||
defaults = {p.get("name"): p.get("default") for p in info.get("cli_params") or [] if p.get("kind") == "option"}
|
||||
return {
|
||||
k: v
|
||||
for k, v in service_options(data, defaults).items()
|
||||
if v is not None and (v is not False or defaults[k] is not False)
|
||||
}
|
||||
|
||||
|
||||
def make_remote_service(
|
||||
|
||||
Reference in New Issue
Block a user