mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #8794/249126f4 backport][stable-9] proxmox inventory: fixing possible concatenation error (#8818)
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
(cherry picked from commit 249126f429
)
Co-authored-by: Simon Siebert <Mail@simonsiebert.de>
This commit is contained in:
parent
594ca4f983
commit
19613ce111
2 changed files with 5 additions and 2 deletions
|
@ -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,6 +329,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
||||||
data = json['data']
|
data = json['data']
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
if json['data']:
|
||||||
# /hosts 's 'results' is a list of all hosts, returned is paginated
|
# /hosts 's 'results' is a list of all hosts, returned is paginated
|
||||||
data = data + json['data']
|
data = data + json['data']
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in a new issue