mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 07:01:22 -07:00
Get the moid in a more failsafe manner
This commit is contained in:
parent
4c0889e8fc
commit
1c1c89927d
1 changed files with 5 additions and 1 deletions
|
@ -235,7 +235,11 @@ def compile_folder_path_for_object(vobj):
|
||||||
thisobj = vobj
|
thisobj = vobj
|
||||||
while hasattr(thisobj, 'parent'):
|
while hasattr(thisobj, 'parent'):
|
||||||
thisobj = thisobj.parent
|
thisobj = thisobj.parent
|
||||||
if thisobj._moId == 'group-d1':
|
try:
|
||||||
|
moid = thisobj._moId
|
||||||
|
except AttributeError:
|
||||||
|
moid = None
|
||||||
|
if moid == 'group-d1':
|
||||||
break
|
break
|
||||||
if isinstance(thisobj, vim.Folder):
|
if isinstance(thisobj, vim.Folder):
|
||||||
paths.append(thisobj.name)
|
paths.append(thisobj.name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue