Bug 2120149 - Environment variable name is inconsistent between stackrc and overcloudrc, OS_CLOUD and OS_CLOUDNAME
Summary: Environment variable name is inconsistent between stackrc and overcloudrc, OS...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-common
Version: 17.0 (Wallaby)
Hardware: x86_64
OS: Linux
low
low
Target Milestone: z1
: 17.0
Assignee: Takashi Kajinami
QA Contact: David Rosenfeld
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-22 01:25 UTC by yatanaka
Modified: 2023-01-25 12:29 UTC (History)
8 users (show)

Fixed In Version: openstack-tripleo-common-15.4.1-0.20221122090255.51f6577.el9ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-01-25 12:28:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1987234 0 None None None 2022-08-22 04:34:06 UTC
OpenStack gerrit 853911 0 None master: MERGED tripleo-common: overcloudrc: Replace OS_CLOUDNAME by OS_CLOUD (If3ac25384412f02b23b6f8e5de918abac47df826) 2022-12-07 20:26:13 UTC
OpenStack gerrit 855556 0 None stable/wallaby: MERGED tripleo-common: overcloudrc: Replace OS_CLOUDNAME by OS_CLOUD (If3ac25384412f02b23b6f8e5de918abac47df826) 2022-12-07 20:26:20 UTC
Red Hat Issue Tracker OSP-18291 0 None None None 2022-08-22 01:52:21 UTC
Red Hat Product Errata RHBA-2023:0271 0 None None None 2023-01-25 12:29:08 UTC

Description yatanaka 2022-08-22 01:25:48 UTC
Description of problem:

stackrc defines `OS_CLOUD`.
~~~
[stack@undercloud ~]$ cat stackrc 
# Clear any old environment that may conflict.
for key in $( set | awk -F= '/^OS_/ {print $1}' ); do unset "${key}" ; done
export OS_CLOUD=undercloud
# Add OS_CLOUDNAME to PS1
if [ -z "${CLOUDPROMPT_ENABLED:-}" ]; then
    export PS1=${PS1:-""}
    export PS1=\${OS_CLOUD:+"(\$OS_CLOUD)"}\ $PS1
    export CLOUDPROMPT_ENABLED=1
fi
~~~

On the otherhand, overcloudrc defines `OS_CLOUDNAME`
~~~
 [stack@undercloud ~]$ cat overcloudrc
# Clear any old environment that may conflict.
for key in $( set | awk '{FS="="}  /^OS_/ {print $1}' ); do unset $key ; done
  :
export OS_CLOUDNAME=overcloud
  :

# Add OS_CLOUDNAME to PS1
if [ -z "${CLOUDPROMPT_ENABLED:-}" ]; then
    export PS1=${PS1:-""}
    export PS1=\${OS_CLOUDNAME:+"(\$OS_CLOUDNAME)"}\ $PS1
    export CLOUDPROMPT_ENABLED=1
fi
~~~

This difference causes lack of bash prompt display as below.

< soruce stackrc ==> overcloudrc >
~~~
[stack@undercloud ~]$ source stackrc
(undercloud) [stack@undercloud ~]$ source overcloudrc
 [stack@undercloud ~]$ 
~~~

< source overcloudrc ==> stackrc>
~~~
[stack@undercloud ~]$ source overcloudrc
(overcloud) [stack@undercloud ~]$ source stackrc 
 [stack@undercloud ~]$ 
~~~

I think both should be "OS_CLOUDNAME", not "OS_CLOUD", because we used "OS_CLOUDNAME" in RHOSP 16.



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


How reproducible:
Install undercloud and then deploy overcloud.


Actual results:
stackrc defines OS_CLOUD, but overcloudrc defines OS_CLOUDNAME.


Expected results:
Both stackrc and overcloudrc define OS_CLOUDNAME.

Comment 1 Takashi Kajinami 2022-08-22 04:16:01 UTC
This looks like a regression caused by https://review.opendev.org/c/openstack/tripleo-heat-templates/+/795203 .

AS is mentioned we should use OS_CLOUDNAME consistently so that switching from overcloudrc to stackrc works.

Comment 14 errata-xmlrpc 2023-01-25 12:28:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat OpenStack Platform 17.0.1 bug fix and enhancement advisory), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:0271


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