Bug 1130381

Summary: 'server list' show "don't have any servers configured" when has no express.conf file under .openshift
Product: OpenShift Online Reporter: XiuJuan Wang <xiuwang>
Component: ocAssignee: Fabiano Franz <ffranz>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: jokerman, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-10 00:50:34 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:

Description XiuJuan Wang 2014-08-15 05:11:15 UTC
Description of problem:
Add multiple servers,set one as default.Delete express.conf under .openshift. server.yml is still existing.
Do 'server list',show "You don't have any servers configured. Use 'rhc setup' to configure your OpenShift server."Do domain show operation,will login to PROD server always.

RHC will check express.conf firstly.
# rhc server list  -d
DEBUG: Using config file /root/.openshift/express.conf
You don't have any servers configured. Use 'rhc setup' to configure your OpenShift server.
Version-Release number of selected component (if applicable):
rhc-1.29.5

How reproducible:
always

Steps to Reproduce:
1.Add some servers, set one as default.
2.Do server list
3.Delele express.conf
4.Do 'rhc server list'
5.Do 'rhc Domain show'

Actual results:
step2.Could list servers
# rhc server list 
Server 'int' (in use)
---------------------
  Hostname:        int.openshift.redhat.com
  Login:           xiuwang+m
  Use Auth Tokens: true
  Insecure:        false

Server 'stg'
------------
  Hostname:        stg.openshift.redhat.com
  Login:           xiuwang
  Use Auth Tokens: true
  Insecure:        false

setp4.
# rhc server list 
You don't have any servers configured. Use 'rhc setup' to configure your OpenShift server.

step5.Actually, have set int as default server.but domain show will login PROD.
# rhc domain show  
You have not yet configured the OpenShift client tools. Please run 'rhc setup'.
Login to openshift.redhat.com: 

Expected results:
Could use the correct server.

Additional info:

Comment 1 Fabiano Franz 2014-08-18 21:40:56 UTC
Looks live this one is fixed by the same fix in bug 1126388:

https://github.com/openshift/rhc/pull/642

'rhc servers' will still list the ones present in servers.yml and online (prod) will be displayed as the default (in use).

Please test.

Comment 2 XiuJuan Wang 2014-08-19 03:14:40 UTC
Check with rhc-1.29.6 build from devenv_4096
1.When openshift.redhat.com not configured and no express.conf existing,still show warning.

# rhc server list 
Server 'int'
------------
  Hostname:        int.openshift.redhat.com
  Login:           XXXXXX
  Use Auth Tokens: true
  Insecure:        false

Server 'stg' (in use)
---------------------
  Hostname:        stg.openshift.redhat.com
  Login:           XXXXXXXXXXX
  Use Auth Tokens: true
  Insecure:        false

You have 2 servers configured. Use 'rhc server use <hostname|nickname>' to switch between them.
# rm express.conf 
# rhc server list 
You don't have any servers configured. Use 'rhc setup' to configure your OpenShift server.

Comment 3 XiuJuan Wang 2014-08-19 03:21:48 UTC
Correct comment 2
Check this bug with rhc-1.29.6 build from devenv_5089.

Comment 4 Fabiano Franz 2014-08-19 17:31:08 UTC
That's the expected behavior. 

When you have multiple servers on servers.yml the express.conf file is used to define which of them is the default one (in use). If you don't have the default one declared on express.conf (or no express.conf at all) then the online server is supposed to be the default one.

Not having express.conf (makes online the default) *and* not having online configured in servers.yml means you don't have a proper servers configuration and should run rhc setup to fix it.

Comment 5 XiuJuan Wang 2014-08-20 03:09:04 UTC
(In reply to Fabiano Franz from comment #4)

Move bug to verified.
Fabiano, Thanks!