mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-09-04 03:05:32 +00:00
fix: drop the client-side -Storage/-Full guard from the Copy cmdlets
PVE returns the same error itself when storage is sent on a linked clone, so the guard only saved one round trip, had no test, and rested on a behaviour claim the OpenAPI spec does not document.
This commit is contained in:
committed by
GitHub
parent
4ec528edbc
commit
bfe2483d22
@@ -72,13 +72,6 @@ namespace PSProxmoxVE.Cmdlets.Containers
|
|||||||
|
|
||||||
protected override void ProcessRecord()
|
protected override void ProcessRecord()
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(Storage) && !Full.IsPresent)
|
|
||||||
ThrowTerminatingError(new ErrorRecord(
|
|
||||||
new PSArgumentException("-Storage is only valid together with -Full; PVE rejects a target storage on a linked clone.", nameof(Storage)),
|
|
||||||
"StorageRequiresFullClone",
|
|
||||||
ErrorCategory.InvalidArgument,
|
|
||||||
Storage));
|
|
||||||
|
|
||||||
var target = TargetNode ?? SourceNode;
|
var target = TargetNode ?? SourceNode;
|
||||||
if (!ShouldProcess($"Container {VmId} on node '{SourceNode}' to new container on node '{target}'", "Copy-PveContainer"))
|
if (!ShouldProcess($"Container {VmId} on node '{SourceNode}' to new container on node '{target}'", "Copy-PveContainer"))
|
||||||
return;
|
return;
|
||||||
@@ -103,7 +96,7 @@ namespace PSProxmoxVE.Cmdlets.Containers
|
|||||||
if (Wait.IsPresent)
|
if (Wait.IsPresent)
|
||||||
{
|
{
|
||||||
var taskService = new TaskService();
|
var taskService = new TaskService();
|
||||||
task = taskService.WaitForTask(session, task.Node ?? SourceNode, task.Upid!, null, null, null);
|
task = taskService.WaitForTask(session, task.Node ?? SourceNode, task.Upid!);
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteObject(task);
|
WriteObject(task);
|
||||||
|
|||||||
@@ -72,13 +72,6 @@ namespace PSProxmoxVE.Cmdlets.Vms
|
|||||||
|
|
||||||
protected override void ProcessRecord()
|
protected override void ProcessRecord()
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(Storage) && !Full.IsPresent)
|
|
||||||
ThrowTerminatingError(new ErrorRecord(
|
|
||||||
new PSArgumentException("-Storage is only valid together with -Full; PVE rejects a target storage on a linked clone.", nameof(Storage)),
|
|
||||||
"StorageRequiresFullClone",
|
|
||||||
ErrorCategory.InvalidArgument,
|
|
||||||
Storage));
|
|
||||||
|
|
||||||
var target = TargetNode ?? SourceNode;
|
var target = TargetNode ?? SourceNode;
|
||||||
if (!ShouldProcess($"VM {VmId} on node '{SourceNode}' to new VM on node '{target}'", "Copy-PveVm"))
|
if (!ShouldProcess($"VM {VmId} on node '{SourceNode}' to new VM on node '{target}'", "Copy-PveVm"))
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user