Handle special service where package is not available (#45155)
There are several services e.g. vmware-fdm, which does not have package name and package description which will raise a error if queried for. Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
885ee25375
commit
b3b65d16b8
1 changed files with 14 additions and 11 deletions
|
@ -108,14 +108,16 @@ class VmwareServiceManager(PyVmomi):
|
|||
if host_service_system:
|
||||
services = host_service_system.serviceInfo.service
|
||||
for service in services:
|
||||
host_service_facts.append(dict(key=service.key,
|
||||
host_service_facts.append(
|
||||
dict(
|
||||
key=service.key,
|
||||
label=service.label,
|
||||
required=service.required,
|
||||
uninstallable=service.uninstallable,
|
||||
running=service.running,
|
||||
policy=service.policy,
|
||||
source_package_name=service.sourcePackage.sourcePackageName,
|
||||
source_package_desc=service.sourcePackage.description,
|
||||
source_package_name=service.sourcePackage.sourcePackageName if service.sourcePackage else 'NA',
|
||||
source_package_desc=service.sourcePackage.description if service.sourcePackage else 'NA',
|
||||
)
|
||||
)
|
||||
hosts_facts[host.name] = host_service_facts
|
||||
|
@ -133,7 +135,8 @@ def main():
|
|||
argument_spec=argument_spec,
|
||||
required_one_of=[
|
||||
['cluster_name', 'esxi_hostname'],
|
||||
]
|
||||
],
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
vmware_host_service_config = VmwareServiceManager(module)
|
||||
|
|
Loading…
Reference in a new issue