fix configure

This commit is contained in:
Xi Yan 2024-09-14 14:17:28 -07:00
parent 3dca86684c
commit 24e21a12e5

View file

@ -47,14 +47,15 @@ class StackConfigure(Subcommand):
def _run_stack_configure_cmd(self, args: argparse.Namespace) -> None: def _run_stack_configure_cmd(self, args: argparse.Namespace) -> None:
from llama_toolchain.core.package import ImageType from llama_toolchain.core.package import ImageType
with open(args.config, "r") as f: build_config_file = Path(args.config)
try: if not build_config_file.exists():
build_config = BuildConfig(**yaml.safe_load(f)) self.parser.error(
except Exception as e: f"Could not find {build_config_file}. Please run `llama stack build` first"
self.parser.error( )
f"Could not find {config_file}. Please run `llama stack build` first" return
)
return with open(build_config_file, "r") as f:
build_config = BuildConfig(**yaml.safe_load(f))
self._configure_llama_distribution(build_config) self._configure_llama_distribution(build_config)
@ -76,7 +77,7 @@ class StackConfigure(Subcommand):
if package_file.exists(): if package_file.exists():
cprint( cprint(
f"Configuration already exists for {build_config.distribution}. Will overwrite...", f"Configuration already exists for {build_config.name}. Will overwrite...",
"yellow", "yellow",
attrs=["bold"], attrs=["bold"],
) )