VMware: add trailing / in case of nested folders (#33479)
This fix adds a trailing / in case of nested folders. Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
38b8d62e68
commit
8d61583c02
1 changed files with 6 additions and 2 deletions
|
@ -1339,13 +1339,17 @@ class PyVmomiHelper(PyVmomi):
|
|||
|
||||
dcpath = compile_folder_path_for_object(datacenter)
|
||||
|
||||
# Nested folder does not have trailing /
|
||||
if not dcpath.endswith('/'):
|
||||
dcpath += '/'
|
||||
|
||||
# Check for full path first in case it was already supplied
|
||||
if (self.params['folder'].startswith(dcpath + self.params['datacenter'] + '/vm') or
|
||||
self.params['folder'].startswith(dcpath + '/' + self.params['datacenter'] + '/vm')):
|
||||
fullpath = self.params['folder']
|
||||
elif (self.params['folder'].startswith('/vm/') or self.params['folder'] == '/vm'):
|
||||
elif self.params['folder'].startswith('/vm/') or self.params['folder'] == '/vm':
|
||||
fullpath = "%s%s%s" % (dcpath, self.params['datacenter'], self.params['folder'])
|
||||
elif (self.params['folder'].startswith('/')):
|
||||
elif self.params['folder'].startswith('/'):
|
||||
fullpath = "%s%s/vm%s" % (dcpath, self.params['datacenter'], self.params['folder'])
|
||||
else:
|
||||
fullpath = "%s%s/vm/%s" % (dcpath, self.params['datacenter'], self.params['folder'])
|
||||
|
|
Loading…
Reference in a new issue