Bug 1023391

Summary: oo-admin-check-source doesn't need to check resource when no role is detected.
Product: OpenShift Container Platform Reporter: Ma xiaoqiang <xiama>
Component: NodeAssignee: John W. Lamb <jolamb>
Status: CLOSED ERRATA QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 2.0.0CC: bleanhar, libra-onpremise-devel, xtian
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: 2013-12-16 09:11:09 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 Ma xiaoqiang 2013-10-25 10:30:35 UTC
Description of problem:
Using the tool to guess the roles of server, when no role is detected, it doesn't  need to check resource. 

Version-Release number of selected component (if applicable):
https://github.com/openshift/openshift-extras/tree/enterprise-2.0/admin/check-sources

How reproducible:
always
Steps to Reproduce:
1.register rhn channel 
#rhnreg_ks --username=user --password=passwd --serverUrl=https://xmlrpc.rhn.errata.stage.redhat.com/XMLRPC
2.run command  to guess roles 
./oo-admin-check-sources.py  
       
Actual results:
Output:
No roles have been specified. Attempting to guess the roles for this system...
No roles could be detected.
Checking if yum-plugin-priorities is installed
Checking channel/repository priorities
Don't need to check resource when no role is detected.

Expected results:
The tool does not need to check resource.

Additional info:

Comment 2 John W. Lamb 2013-10-29 15:01:47 UTC
Addressed in https://github.com/openshift/openshift-extras/pull/118

Comment 3 Ma xiaoqiang 2013-10-30 01:02:49 UTC
check it on a clean server with registered channels

# python oo-admin-check-sources.py 
Output:
No roles have been specified. Attempting to guess the roles for this system...
No roles could be detected.
Detected installed OpenShift Enterprise version 2.0
Checking if yum-plugin-priorities is installed
Please specify at least one role for this system with the --role command
Please re-run this tool after making any recommended repairs to this system

Comment 4 Ma xiaoqiang 2013-10-31 02:37:16 UTC
check it on the new version 

#python oo-admin-check-sources.py
Output:

No roles have been specified. Attempting to guess the roles for this system...
No roles could be detected.
Detected OpenShift Enterprise repository subscription managed by Red Hat Subscription Manager.
Detected installed OpenShift Enterprise version 2.0
The following OpenShift Enterprise repositories conflict with the detected or specified product version and should be disabled to prevent package conflicts:
    rhel-server-ose-1.2-node-6-rpms
    rhel-x86_64-server-6-ose-1.2-infrastructure
    rhel-server-ose-1.2-rhc-6-rpms
    rhel-server-ose-1.2-infra-6-rpms


No role is detected, the tool still check the resource.

Comment 5 Brenton Leanhardt 2013-10-31 15:46:21 UTC
Thanks for being so thorough. :)  In general the goal for oo-admin-check-sources.py can be summarized as follows:

1) Always provide helpful output
2) Fail as soon as the tool doesn't have enough information to proceed
3) If the user corrects a problem, detect that and then show them the next problem.
4) Once everything is correct let the user know

In this scenario it's being detected that OSE 2.0 is installed.  We actually don't want the user to have the 1.2 content sets enabled so if the tool can detect that at this point in the workflow we should advise the user to correct the situation.

If it's not correctly detecting the installed version correctly then that would be a bug.  If this makes sense to you then we could mark if VERIFIED.

Comment 6 John W. Lamb 2013-10-31 15:53:01 UTC
I would like to add that if the version is incorrectly guessed, listing the (wrong) conflicting repos gives the user a chance to say "hey, that's the opposite of what I want", at which point they will hopefully review the options and specify the appropriate version AND the role(s).