mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-03 17:23:09 +00:00
Locate prtdiag even when absent from /usr/bin (#44113)
* Locate prtdiag even when absent from /usr/bin
On Solaris 8 hosts, this prevents fact collection from aborting with:
Argument 'args' to run_command must be list or string
* Lint fix.
* Style: pass /usr/platform/.../sbin as optional path to get_bin_path().
This commit is contained in:
3
changelogs/fragments/solaris-prtdiag-path.yaml
Normal file
3
changelogs/fragments/solaris-prtdiag-path.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
bugfixes:
|
||||
- Hardware fact gathering now completes on Solaris 8. Previously, it aborted with error `Argument 'args' to run_command must be list or string`.
|
||||
@@ -168,8 +168,13 @@ class SunOSHardware(Hardware):
|
||||
def get_dmi_facts(self):
|
||||
dmi_facts = {}
|
||||
|
||||
uname_path = self.module.get_bin_path("prtdiag")
|
||||
rc, out, err = self.module.run_command(uname_path)
|
||||
# On Solaris 8 the prtdiag wrapper is absent from /usr/sbin,
|
||||
# but that's okay, because we know where to find the real thing:
|
||||
rc, platform, err = self.module.run_command('/usr/bin/uname -i')
|
||||
platform_sbin = '/usr/platform/' + platform.rstrip() + '/sbin'
|
||||
|
||||
prtdiag_path = self.module.get_bin_path("prtdiag", opt_dirs=[platform_sbin])
|
||||
rc, out, err = self.module.run_command(prtdiag_path)
|
||||
"""
|
||||
rc returns 1
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user