Added '--raw' option to vds clone

This commit is contained in:
lulzette 2022-07-10 04:17:27 +03:00
parent 94953ccf16
commit 288ccd7357

View File

@ -581,6 +581,13 @@ def vds_clone(vds_id: Optional[int] = typer.Argument(None),
Clone VDS Clone VDS
""" """
if vds_id is None: if vds_id is None:
if raw:
print(
dict(
error="No VDS ID provided"
)
)
return 1
vds_list() vds_list()
vds_id = input("Enter VDS ID: ") vds_id = input("Enter VDS ID: ")
new_vds = Server.clone(vds_id) new_vds = Server.clone(vds_id)
@ -588,6 +595,9 @@ def vds_clone(vds_id: Optional[int] = typer.Argument(None),
print(typer.style("Error", fg=typer.colors.RED)) print(typer.style("Error", fg=typer.colors.RED))
sys.exit(1) sys.exit(1)
else: else:
if raw:
print(new_vds)
return
new_vds = new_vds['server'] new_vds = new_vds['server']
for frame in cycle(r'-\|/'): for frame in cycle(r'-\|/'):