Skip to content

Commit 83538bb

Browse files
committed
linting
1 parent 0367430 commit 83538bb

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

mcpgateway/admin.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ async def admin_add_gateway(request: Request, db: Session = Depends(get_db), use
755755
name=form["name"],
756756
url=form["url"],
757757
description=form.get("description"),
758-
transport=form.get("transport","SSE"),
758+
transport=form.get("transport", "SSE"),
759759
auth_type=form.get("auth_type", ""),
760760
auth_username=form.get("auth_username", ""),
761761
auth_password=form.get("auth_password", ""),
@@ -770,12 +770,12 @@ async def admin_add_gateway(request: Request, db: Session = Depends(get_db), use
770770
except Exception as ex:
771771
if isinstance(ex, GatewayConnectionError):
772772
return RedirectResponse(f"{root_path}/admin#gateways", status_code=502)
773-
elif isinstance(ex, ValueError):
773+
if isinstance(ex, ValueError):
774774
return RedirectResponse(f"{root_path}/admin#gateways", status_code=400)
775-
elif isinstance(ex, RuntimeError):
776-
return RedirectResponse(f"{root_path}/admin#gateways", status_code=500)
777-
else:
775+
if isinstance(ex, RuntimeError):
778776
return RedirectResponse(f"{root_path}/admin#gateways", status_code=500)
777+
778+
return RedirectResponse(f"{root_path}/admin#gateways", status_code=500)
779779

780780

781781
@admin_router.post("/gateways/{gateway_id}/edit")
@@ -807,7 +807,7 @@ async def admin_edit_gateway(
807807
name=form["name"],
808808
url=form["url"],
809809
description=form.get("description"),
810-
transport=form.get("transport","SSE"),
810+
transport=form.get("transport", "SSE"),
811811
auth_type=form.get("auth_type", None),
812812
auth_username=form.get("auth_username", None),
813813
auth_password=form.get("auth_password", None),

mcpgateway/services/gateway_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,8 @@ async def check_health_of_gateways(self, gateways: List[DbGateway]) -> bool:
576576

577577
# Perform the GET and raise on 4xx/5xx
578578
if (gateway.transport).lower() == "sse":
579-
timeout = httpx.Timeout(settings.health_check_timeout)
580-
async with client.stream("GET", gateway.url, headers=headers,timeout=timeout) as response:
579+
timeout = httpx.Timeout(settings.health_check_timeout)
580+
async with client.stream("GET", gateway.url, headers=headers, timeout=timeout) as response:
581581
# This will raise immediately if status is 4xx/5xx
582582
response.raise_for_status()
583583
elif (gateway.transport).lower() == "streamablehttp":
@@ -640,7 +640,7 @@ async def subscribe_events(self) -> AsyncGenerator[Dict[str, Any], None]:
640640
finally:
641641
self._event_subscribers.remove(queue)
642642

643-
async def _initialize_gateway(self, url: str, authentication: Optional[Dict[str, str]] = None, transport: str= "sse") -> Any:
643+
async def _initialize_gateway(self, url: str, authentication: Optional[Dict[str, str]] = None, transport: str = "SSE") -> Any:
644644
"""Initialize connection to a gateway and retrieve its capabilities.
645645
646646
Args:

mcpgateway/transports/streamablehttp_transport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
from typing import List, Union
2626
from uuid import uuid4
2727

28-
from mcp import types
2928
from fastapi.security.utils import get_authorization_scheme_param
29+
from mcp import types
3030
from mcp.server.lowlevel import Server
3131
from mcp.server.streamable_http import (
3232
EventCallback,

0 commit comments

Comments
 (0)