mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
proxmox inventory: fixing possible concatenation error (#8794)
* Fixing possible concatination error * Create 8794-Fixing-possible-concatination-error.yaml * Update 8794-Fixing-possible-concatination-error.yaml Updating changelog
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
bugfixes:
|
||||||
|
- proxmox inventory plugin - fixed a possible error on concatenating responses from proxmox. In case an API call unexpectedly returned an empty result, the inventory failed with a fatal error. Added check for empty response (https://github.com/ansible-collections/community.general/issues/8798, https://github.com/ansible-collections/community.general/pull/8794).
|
||||||
@@ -329,8 +329,9 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
|||||||
data = json['data']
|
data = json['data']
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
# /hosts 's 'results' is a list of all hosts, returned is paginated
|
if json['data']:
|
||||||
data = data + json['data']
|
# /hosts 's 'results' is a list of all hosts, returned is paginated
|
||||||
|
data = data + json['data']
|
||||||
break
|
break
|
||||||
|
|
||||||
self._cache[self.cache_key][url] = data
|
self._cache[self.cache_key][url] = data
|
||||||
|
|||||||
Reference in New Issue
Block a user