vmware / vsphere-automation-sdk-python

Python samples, language bindings, and API reference documentation for vSphere, VMC, and NSX-T using the VMware REST API
MIT License
746 stars 313 forks source link

Deleting an empty online depot results in error #348

Closed VedaNiks closed 1 year ago

VedaNiks commented 1 year ago

Describe the bug

We use delete_task(depot) API call [ref] from vCenter to delete the download source.

From the doc, I understand this API does 2 things:

  1. Deletes the created download source
  2. Removes content imported from the download source.

In our case, when the delete_task(depot) was called, there was no imported content present on the vCenter. Below error was thrown:

A general system error occurred: Cannot find the content of online depot 'https://depot-url/index.xml'. Either the depot's content has not been imported yet or has already been deleted or the depot was migrated from an old version of vSphere Lifecycle Manager that does not support this operation.

The error occurs only when the user tries to delete a download source with no imported content. In case, vLCM has imported/synched the content from depot, delete_task(depot) runs without error.

Reproduction steps

  1. Create a online depot without any content
  2. Go to Lifecycle Manager -> Actions -> Sync Updates
  3. Call delete_task(depot)

Expected behavior

In case, when the delete_task(depot) is called for an online depot with no imported content present; an error should not be thrown, since there is nothing to delete. You can mark this task as completed and add in the message that no content available for deletion.

Additional context

Use list() [ref] to get a list of depots present on the vCenter server.

jobingeo commented 1 year ago

@VedaNiks We acknowledge this issue.
Please expect a fix for this to be available in the next server update release, 8.0 Update1.

jobingeo commented 1 year ago

Issue fixed in 8.0 U1 release