Bug 1471170 - [Docs][HCI] Documentation for numa-systemd-osd.sh is using wrong Bash result checking.
[Docs][HCI] Documentation for numa-systemd-osd.sh is using wrong Bash result ...
Status: NEW
Product: Red Hat OpenStack
Classification: Red Hat
Component: documentation (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: RHOS Documentation Team
RHOS Documentation Team
: Documentation
Depends On:
  Show dependency treegraph
Reported: 2017-07-14 11:03 EDT by David Gurtner
Modified: 2017-08-02 11:04 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Fixed version of numa-systemd-osd.sh (2.36 KB, application/x-shellscript)
2017-07-14 11:03 EDT, David Gurtner
no flags Details

  None (edit)
Description David Gurtner 2017-07-14 11:03:22 EDT
Created attachment 1298399 [details]
Fixed version of numa-systemd-osd.sh

Description of problem:
The numa-systemd-osd.sh script documented in https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/11/html/hyper-converged_infrastructure_guide/appendix-main#appendix-upstream-numa has errors in how the result of previous command is checked. As a result the script fails.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. use the default overcloud-full.qcow2 image which does not contain numactl and hwloc
2. Configure NUMA pinning for HCI according to https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/11/html/hyper-converged_infrastructure_guide/appendix-main#appendix-upstream-numa

Actual results:
Deployment fails when executing the script as check for numactl and hwloc gets a false positive

Expected results:
Script succeeds

Additional info:
The problem is that the checks, for example in line 13 "if [[ ! $(rpm -q $PKG) ]]; then" outputs some text to stdout, specifically "package numactl is not installed" the script then checks for [[ ! package numactl is not installed ]], which is always true. Instead the script should check for the return code of rpm -q $PKG using $?. A working (and tested) version of the script is attached.

Note You need to log in before you can comment on or make changes to this bug.