Skip to content
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 devservices/commands/down.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def down(args: Namespace) -> None:
exit(1)

modes = service.config.modes
exclude_local = args.exclude_local
exclude_local = getattr(args, "exclude_local", False)

state = State()
starting_services = set(state.get_service_entries(StateTables.STARTING_SERVICES))
Expand Down
1 change: 1 addition & 0 deletions devservices/commands/toggle.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def restart_dependent_services(
service_name=dependent_service,
mode=mode,
debug=False,
exclude_local=True,
)
try:
up(args)
Expand Down
7 changes: 4 additions & 3 deletions devservices/commands/up.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def up(args: Namespace, existing_status: Status | None = None) -> None:

modes = service.config.modes
mode = args.mode
exclude_local = getattr(args, "exclude_local", False)

state = State()

Expand All @@ -109,7 +110,7 @@ def up(args: Namespace, existing_status: Status | None = None) -> None:
and service_with_local_runtime in modes[mode]
):
local_runtime_dependency_names.add(service_with_local_runtime)
if args.exclude_local:
if exclude_local:
status.warning(
f"Skipping '{service_with_local_runtime}' as it is set to run locally"
)
Expand Down Expand Up @@ -142,7 +143,7 @@ def up(args: Namespace, existing_status: Status | None = None) -> None:
and service_with_local_runtime not in local_runtime_dependency_names
):
local_runtime_dependency_names.add(service_with_local_runtime)
if args.exclude_local:
if exclude_local:
status.warning(
f"Skipping '{service_with_local_runtime}' as it is set to run locally"
)
Expand All @@ -155,7 +156,7 @@ def up(args: Namespace, existing_status: Status | None = None) -> None:
for dep in remote_dependencies
if dep.service_name not in services_with_local_runtime
}
if not args.exclude_local and len(local_runtime_dependency_names) > 0:
if not exclude_local and len(local_runtime_dependency_names) > 0:
status.warning("Starting dependencies with local runtimes...")
for local_runtime_dependency_name in local_runtime_dependency_names:
up(
Expand Down
9 changes: 9 additions & 0 deletions tests/commands/test_toggle.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,7 @@ def test_restart_dependent_services_single_dependent_service_single_mode(
service_name="dependent-service",
mode="default",
debug=False,
exclude_local=True,
)
)

Expand Down Expand Up @@ -963,13 +964,15 @@ def test_restart_dependent_services_single_dependent_service_multiple_modes(
service_name="dependent-service",
mode="default",
debug=False,
exclude_local=True,
)
),
mock.call(
Namespace(
service_name="dependent-service",
mode="other-mode",
debug=False,
exclude_local=True,
)
),
]
Expand Down Expand Up @@ -1003,13 +1006,15 @@ def test_restart_dependent_services_multiple_dependent_services_single_mode(
service_name="dependent-service",
mode="default",
debug=False,
exclude_local=True,
)
),
mock.call(
Namespace(
service_name="other-dependent-service",
mode="default",
debug=False,
exclude_local=True,
)
),
]
Expand Down Expand Up @@ -1046,27 +1051,31 @@ def test_restart_dependent_services_multiple_dependent_services_multiple_modes(
service_name="dependent-service",
mode="default",
debug=False,
exclude_local=True,
)
),
mock.call(
Namespace(
service_name="dependent-service",
mode="other-mode",
debug=False,
exclude_local=True,
)
),
mock.call(
Namespace(
service_name="other-dependent-service",
mode="default",
debug=False,
exclude_local=True,
)
),
mock.call(
Namespace(
service_name="other-dependent-service",
mode="other-mode",
debug=False,
exclude_local=True,
)
),
]
Expand Down
Loading