mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 09:53:45 +00:00
chore: add a check for None
route.methods can be None so let's check for that to make mypy happy :) Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
parent
3ce509e94a
commit
1ffaa04f09
1 changed files with 10 additions and 7 deletions
|
|
@ -100,10 +100,13 @@ class DistributionInspectImpl(Inspect):
|
||||||
router_routes = get_router_routes(router)
|
router_routes = get_router_routes(router)
|
||||||
for route in router_routes:
|
for route in router_routes:
|
||||||
if _should_include_router_route(route, router.prefix):
|
if _should_include_router_route(route, router.prefix):
|
||||||
|
if route.methods is not None:
|
||||||
|
available_methods = [m for m in route.methods if m != "HEAD"]
|
||||||
|
if available_methods:
|
||||||
ret.append(
|
ret.append(
|
||||||
RouteInfo(
|
RouteInfo(
|
||||||
route=route.path,
|
route=route.path,
|
||||||
method=next(iter([m for m in route.methods if m != "HEAD"])),
|
method=available_methods[0],
|
||||||
provider_types=_get_provider_types(api),
|
provider_types=_get_provider_types(api),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue