Added newlines against buffering for log streaming. Fixed cli
This commit is contained in:
@@ -37,8 +37,8 @@ def create(args: argparse.Namespace) -> None:
|
||||
stream = asyncio.run(vms.get_vm_logs(uuid))
|
||||
|
||||
for line in read_stream_response(stream):
|
||||
print(line)
|
||||
|
||||
print(line, end="")
|
||||
print("")
|
||||
|
||||
def register_create_parser(parser: argparse.ArgumentParser) -> None:
|
||||
parser.add_argument("machine", type=str)
|
||||
|
||||
@@ -164,7 +164,7 @@ async def get_vm_logs(uuid: UUID) -> StreamingResponse:
|
||||
|
||||
@router.post("/api/vms/create")
|
||||
async def create_vm(
|
||||
vm: Annotated[VmConfig, Body()], background_tasks: BackgroundTasks
|
||||
vm: Annotated[VmConfig, Body()]
|
||||
) -> VmCreateResponse:
|
||||
flake_attrs = await get_attrs(vm.flake_url)
|
||||
if vm.flake_attr not in flake_attrs:
|
||||
|
||||
Reference in New Issue
Block a user