Can you tell me how to delete a folder on datastore.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Can you tell me how to delete a folder on datastore.

Clove
pyvmomi.DeleteDatastoreFile("New Datacenter","datastore1/xyz/remote11.iso")
def DeleteDatastoreFile(datacenter, datastorePath):
    try:
        #https://github.com/vmware/pyvmomi/blob/master/docs/vim/DatastoreNamespaceManager.rst
        vim.DatastoreNamespaceManager.DeleteDirectory(datacenter, datastorePath)
    except vmodl.MethodFault as e:
     print("Caught vmodl fault : " + e.msg)
     message = ("Caught vmodl fault : " + e.msg)
     raise Exception(message)

BUT GET AN ERROR "Exception TypeError: For "datacenter" expected type vim.Datacenter, but got str"
Loading...