Incorrect shell script syntax in affine-platform.sh
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
StarlingX |
New
|
Low
|
Unassigned |
Bug Description
Brief Description
-----------------
The "affine-
PIDLIST=$( ps -e -p 2 |grep rcuc | awk '{ print $1; }')
for PID in ${PIDLIST[@]}; do
chrt -p -f 4 ${PID} 2>/dev/null
done
PIDLIST is initialized to a scalar/non-array value with =$(...), but the for loop uses it like a shell array with ${PIDLIST[@]}, which is the syntax for iterating over elements in a shell array.
The problematic code can be seen here: https:/
Thankfully, this syntactic issue appears to be harmless, but it is confusing to the reader.
Severity
--------
Minor
Steps to Reproduce
------------------
None. This is a shell script syntax issue.
Expected Behavior
------------------
Proper array iteration syntax should be used, such as the following example:
https:/
Actual Behavior
----------------
Incorrect shell script syntax.
Reproducibility
---------------
Not applicable.
System Configuration
-------
Not applicable.
Branch/Pull Time/Commit
-------
The issue appears to have been introduced with the following commit from 2019:
commit 66355faf0e771b2
Date: Thu Jun 27 11:47:12 2019 -0400
AIO reaffine tasks and k8s-infra during startup
Last Pass
---------
Not applicable.
Timestamp/Logs
--------------
Not applicable.
Test Activity
-------------
Code review.
Workaround
----------
None required.
tags: | added: stx.config |
Changed in starlingx: | |
importance: | Undecided → Low |