lib.ExecContext.create(): Support path-only URIs

ExecContext.create() relies on properly formed URLs with a schema for
deciding which backend gets created. Create a Local instance if an
URL doesn't have schema.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-04-15 14:04:21 +02:00
commit dbf41d7b48

View file

@ -289,9 +289,9 @@ class ExecContext(abc.ABC):
@classmethod
def create(cls, uri: str, *args, **kwargs) -> Self:
tokens = re.split(r'://', uri)
schema = tokens[0]
schema = tokens[0] if tokens[0] != uri else 'file'
match schema:
case 'local':
case 'local' | 'file':
from .ec.Local import Local
return Local(uri, *args, **kwargs)
case 'ssh':