mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
hpilo: Handle connection error in hpilo_facts (#53952)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
committed by
ansibot
parent
cb2972d647
commit
1ed8ed766c
@@ -132,6 +132,7 @@ except ImportError:
|
|||||||
HAS_HPILO = False
|
HAS_HPILO = False
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
||||||
|
from ansible.module_utils._text import to_native
|
||||||
|
|
||||||
|
|
||||||
# Suppress warnings from hpilo
|
# Suppress warnings from hpilo
|
||||||
@@ -178,7 +179,11 @@ def main():
|
|||||||
}
|
}
|
||||||
|
|
||||||
# TODO: Count number of CPUs, DIMMs and total memory
|
# TODO: Count number of CPUs, DIMMs and total memory
|
||||||
|
try:
|
||||||
data = ilo.get_host_data()
|
data = ilo.get_host_data()
|
||||||
|
except hpilo.IloCommunicationError as e:
|
||||||
|
module.fail_json(msg=to_native(e))
|
||||||
|
|
||||||
for entry in data:
|
for entry in data:
|
||||||
if 'type' not in entry:
|
if 'type' not in entry:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user