mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
restore attribute checks
This commit is contained in:
parent
c66aea5ae8
commit
70284e402a
1 changed files with 4 additions and 3 deletions
|
@ -201,6 +201,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
|
||||||
|
|
||||||
server['name'] = vm.NAME
|
server['name'] = vm.NAME
|
||||||
server['id'] = vm.ID
|
server['id'] = vm.ID
|
||||||
|
if vm.HISTORY_RECORDS.HISTORY:
|
||||||
if isinstance(vm.HISTORY_RECORDS.HISTORY, Sequence) and len(vm.HISTORY_RECORDS.HISTORY) > 0:
|
if isinstance(vm.HISTORY_RECORDS.HISTORY, Sequence) and len(vm.HISTORY_RECORDS.HISTORY) > 0:
|
||||||
if hasattr(vm.HISTORY_RECORDS.HISTORY[-1], 'HOSTNAME'):
|
if hasattr(vm.HISTORY_RECORDS.HISTORY[-1], 'HOSTNAME'):
|
||||||
server['host'] = vm.HISTORY_RECORDS.HISTORY[-1].HOSTNAME
|
server['host'] = vm.HISTORY_RECORDS.HISTORY[-1].HOSTNAME
|
||||||
|
|
Loading…
Reference in a new issue