-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Locate prtdiag even when absent from /usr/bin #44113
Conversation
On Solaris 8 hosts, this prevents fact collection from aborting with: Argument 'args' to run_command must be list or string
The test
|
# but that's okay, because we know where to find the real thing: | ||
if not prtdiag_path: | ||
rc, platform, err = self.module.run_command('/usr/bin/uname -i') | ||
prtdiag_path = '/usr/platform/' + platform.rstrip() + '/sbin/prtdiag' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of assuming that if not found this path does exist, just pass the search pat as an option to get_bin_path and it will error out if even this fallback is not present
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do. Fact gathering is already slow, so I was reluctant to add an additional fork and exec of uname
unless it was required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could still make it conditional, just call get_bin_path again instead of assuming that the binary exists
* 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(). (cherry picked from commit 40fb992)
* 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(). (cherry picked from commit 40fb992)
* 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().
SUMMARY
On Solaris 8, the
prtdiag
wrapper is absent from/usr/sbin
, so we must find the real thing ourselves. This prevents fact collection from aborting.ISSUE TYPE
COMPONENT NAME
Hardware facts.
ANSIBLE VERSION
ADDITIONAL INFORMATION
Before:
After: