Bug 1471170

Summary: [Docs][HCI] Documentation for numa-systemd-osd.sh is using wrong Bash result checking.
Product: Red Hat OpenStack Reporter: David Gurtner <dgurtner>
Component: documentationAssignee: RHOS Documentation Team <rhos-docs>
Status: CLOSED EOL QA Contact: RHOS Documentation Team <rhos-docs>
Severity: unspecified Docs Contact: Derek <dcadzow>
Priority: low    
Version: 11.0 (Ocata)CC: cminkema, jjoyce, jomurphy, kfryklun, nlevinki, srevivo
Target Milestone: ---Keywords: Documentation
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-06 11:08:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fixed version of numa-systemd-osd.sh none

Description David Gurtner 2017-07-14 15:03:22 UTC
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):

11

How reproducible:

always

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.