mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-01 05:49:09 -07:00
Add support for Python3 in vmware_guest_find
* Remove redundant get_obj method * Fix testcase * Correct logic for compile_folder_path_for_object Fixes: #25984 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
c51a4bc57d
commit
8027aad4b8
4 changed files with 8 additions and 24 deletions
|
@ -234,11 +234,11 @@ def compile_folder_path_for_object(vobj):
|
|||
thisobj = vobj
|
||||
while hasattr(thisobj, 'parent'):
|
||||
thisobj = thisobj.parent
|
||||
if thisobj.name == 'Datacenters':
|
||||
break
|
||||
if isinstance(thisobj, vim.Folder):
|
||||
paths.append(thisobj.name)
|
||||
paths.reverse()
|
||||
if paths[0] == 'Datacenters':
|
||||
paths.remove('Datacenters')
|
||||
return '/' + '/'.join(paths)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue