Failure to invoke '/etc/platform/openrc' with bash nounset option

Bug #2051549 reported by Kyle MacLeod
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Kyle MacLeod

Bug Description

Brief Description

Failure to invoke '/etc/platform/openrc' with bash nounset optionSeverity

<Minor: System/Feature is usable with minor issue>

Steps to Reproduce

Invoke '/etc/platform/openrc' in a bash script with nounset option

Expected Behavior

the script should be invoked without issues

Actual Behavior

the shell scripts with nounset option throws an exception regarding unbound variables

Reproducibility

100%

System Configuration

any

Load info (eg: 2022-03-10_20-00-07)

any

Last Pass

new request/scenario

Note: we have some tools in shell scripts that invokes /etc/platform/openrc

Timestamp/Logs

no logs

Alarms

no alarms

Test Activity

test automation

Workaround

pass 'none' as an argument to /etc/platform/openrc

Changed in starlingx:
status: New → In Progress
Kyle MacLeod (kmacleod)
Changed in starlingx:
assignee: nobody → Kyle MacLeod (kmacleod)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to stx-puppet (master)

Reviewed: https://review.opendev.org/c/starlingx/stx-puppet/+/907063
Committed: https://opendev.org/starlingx/stx-puppet/commit/2e60f12f29f62d1697c624e1755c9a8185443bc5
Submitter: "Zuul (22348)"
Branch: master

commit 2e60f12f29f62d1697c624e1755c9a8185443bc5
Author: Kyle MacLeod <email address hidden>
Date: Mon Jan 29 08:49:30 2024 -0500

    Fix openrc source when invoked with bash nounset option

    This change fixes the check for the --no-credentials argument to handle
    the case where no argument is present and nounset is active, i.e.:
      set -o nounset

    In this case we default $1 to "" via ${1:-}

    Test Plan:

    Pass:
    - Build and source the /etc/platform/openrc file with and without
      arguments. Test with and without the nounset option.

    Closes-Bug: 2051549

    Change-Id: Iab7f21d26751b024bf58c41b16aac79daa351abf
    Signed-off-by: Kyle MacLeod <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.9.0 stx.config
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.