llama-stack/llama_stack/cli
Ignas Baranauskas 28930cdab6
fix: handle None external_providers_dir in build with run arg (#2269)
# What does this PR do?
Fixes an issue where running `llama stack build --template ollama
--image-type venv --run` fails with a TypeError when validating external
providers directory paths.

The error occurs because `os.path.exists()` is called with `Path(None)`
instead of converting it to a string first. This change ensures
consistent handling of `None` values for `external_providers_dir` across
both build and
[run](https://github.com/meta-llama/llama-stack/blob/main/llama_stack/cli/stack/run.py#L134)
commands by using `str()` conversion before path validation.

[//]: # (If resolving an issue, uncomment and update the line below)
[//]: # (Closes #[issue-number])

## Test Plan
```bash
INFERENCE_MODEL=llama3.2:3b uv run --with llama-stack llama stack build --template ollama --image-type venv --run
```
Command completes successfully without TypeError

[//]: # (## Documentation)
2025-05-27 09:41:12 +02:00
..
model chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
scripts API Updates (#73) 2024-09-17 19:51:35 -07:00
stack fix: handle None external_providers_dir in build with run arg (#2269) 2025-05-27 09:41:12 +02:00
__init__.py API Updates (#73) 2024-09-17 19:51:35 -07:00
download.py chore: make cprint write to stderr (#2250) 2025-05-24 23:39:57 -07:00
llama.py chore: more mypy fixes (#2029) 2025-05-06 09:52:31 -07:00
subcommand.py API Updates (#73) 2024-09-17 19:51:35 -07:00
table.py chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
verify_download.py chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00