command prompt is not updated correctly when switching between (stack|overcloud)rc

Bug #1987234 reported by Takashi Kajinami
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
High
Takashi Kajinami

Bug Description

Description
===========
This was initially reported in https://bugzilla.redhat.com/show_bug.cgi?id=2120149 .

Since https://review.opendev.org/c/openstack/tripleo-heat-templates/+/795203 the following change was merged, $HOME/stackrc uses OS_CLOUD to display cloud name in command prompt.
On the other hand $HOME/overcloudrc still uses OS_CLOUDNAME.

The problem here is that the CLOUDPROMPT_ENABLED environment is not updated once it is set, and PS1 is not updated to point the appropriate environment.
Because of this, switching these two environments beaks the cloudname output in command prompt.

~~~
[stack@undercloud ~]$ source stackrc
(undercloud) [stack@undercloud ~]$ source overcloudrc
 [stack@undercloud ~]$
~~~

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

Steps to reproduce
==================
* Deploy undercloud/overcloud
* source ~/stackrc
* sourcd ~/overcloudrc

Expected result
===============
Command prompt should include (overcloud)

Actual result
=============
Command prompt does not include (overcloud)

Environment
=============
The issue was initially found in downstream product based on stable/wallaby,
but the issue affects current master as well.

Logs & Configs
==============
N/A

Changed in tripleo:
importance: Undecided → High
assignee: nobody → Takashi Kajinami (kajinamit)
tags: added: wallaby-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (master)
Changed in tripleo:
status: New → In Progress
summary: - cloud name is not present when sourcing overcloudrc after stackrc(or
- stackrc after overcloudrc)
+ command prompt is not updated correctly when switching between
+ (stack|overcloud)rc
Changed in tripleo:
milestone: none → zed-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (master)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-heat-templates (master)

Change abandoned by "Takashi Kajinami <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/853908
Reason: Let's try https://review.opendev.org/c/openstack/tripleo-common/+/853911 instead.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (master)

Reviewed: https://review.opendev.org/c/openstack/tripleo-common/+/853911
Committed: https://opendev.org/openstack/tripleo-common/commit/b14ee1ac8e36c9334ce5d4ca4d238cd4a5927d0a
Submitter: "Zuul (22348)"
Branch: master

commit b14ee1ac8e36c9334ce5d4ca4d238cd4a5927d0a
Author: Takashi Kajinami <email address hidden>
Date: Mon Aug 22 14:05:02 2022 +0900

    overcloudrc: Replace OS_CLOUDNAME by OS_CLOUD

    ... to use the consistent environment in overcloudrc and stackrc.

    This also allows us to use /etc/openstack/clouds.yaml for the modern
    openstack CLI.

    Closes-Bug: #1987234
    Change-Id: If3ac25384412f02b23b6f8e5de918abac47df826

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/tripleo-common/+/855556

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-common 17.0.0

This issue was fixed in the openstack/tripleo-common 17.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/tripleo-common/+/855556
Committed: https://opendev.org/openstack/tripleo-common/commit/4fd4aff389b2b78e129125da09bc79456d296a2c
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 4fd4aff389b2b78e129125da09bc79456d296a2c
Author: Takashi Kajinami <email address hidden>
Date: Mon Aug 22 14:05:02 2022 +0900

    overcloudrc: Replace OS_CLOUDNAME by OS_CLOUD

    ... to use the consistent environment in overcloudrc and stackrc.

    This also allows us to use /etc/openstack/clouds.yaml for the modern
    openstack CLI.

    Closes-Bug: #1987234
    Change-Id: If3ac25384412f02b23b6f8e5de918abac47df826
    (cherry picked from commit b14ee1ac8e36c9334ce5d4ca4d238cd4a5927d0a)

tags: added: in-stable-wallaby
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.