Bug 1465616

Summary: stackrc does not undefine OS_ env vars
Product: Red Hat OpenStack Reporter: Chris Dearborn <christopher_dearborn>
Component: instack-undercloudAssignee: Ben Nemec <bnemec>
Status: CLOSED ERRATA QA Contact: Gurenko Alex <agurenko>
Severity: urgent Docs Contact:
Priority: high    
Version: 10.0 (Newton)CC: arkady_kanevsky, aschultz, bnemec, cdevine, christopher_dearborn, dbecker, dcain, emacchi, jjoyce, John_walsh, jslagle, kurt_hey, mburns, morazi, rajini.karthik, randy_perryman, rhel-osp-director-maint, smerrow, sreichar
Target Milestone: z4Keywords: Triaged, ZStream
Target Release: 10.0 (Newton)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: instack-undercloud-5.3.0-2.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-06 17:03:43 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:
Bug Depends On:    
Bug Blocks: 1356451    

Description Chris Dearborn 2017-06-27 18:56:08 UTC
Description of problem:
If the user sources ~/overcloudrc.v3, does some CLI commands, then sources ~/stackrc, all CLI commands will fail with:
"Cannot use v2 authentication with domain scope"

Version-Release number of selected component (if applicable):
puddles/OpenStack/10.0-RHEL-7/2017-06-19.1/RH7-RHOS-10.0.repo

How reproducible:
Install director and deploy an overcloud.
source ~/overcloudrc.v3
source ~/stackrc
nova list
ERROR (DiscoveryFailure): Cannot use v2 authentication with domain scope

If at this point you do:
unset OS_USER_DOMAIN_NAME
unset OS_PROJECT_DOMAIN_NAME
nova list
It works.

Steps to Reproduce:
See above.

Actual results:
All CLI commands fail with "Cannot use v2 authentication with domain scope".

Expected results:
CLI commands should work after sourcing the v3 rc followed by sourcing the stackrc.

Additional info:
This can be fixed by adding the following line (taken from overcloudrc) to the beginning of stackrc:

for key in $( set | awk '{FS="="}  /^OS_/ {print $1}' ); do unset $key ; done

Comment 1 Ben Nemec 2017-06-29 18:41:20 UTC
This was fixed in OSP 11, so it just needs a backport.  I've proposed that upstream (there are actually two patches because the first one was broken).

Comment 4 Gurenko Alex 2017-08-27 10:22:15 UTC
Verified on build: 2017-08-22.2

rpm -q instack-undercloud
instack-undercloud-5.3.0-3.el7ost.noarch

Comment 6 errata-xmlrpc 2017-09-06 17:03:43 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, 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/RHSA-2017:2649