Bug 1028955

Summary: rhc-admin-ctl-plan failed to detect inconistent of user's capability of private_ssl_certificates with plans.
Product: OpenShift Online Reporter: Liang Xia <lxia>
Component: PodAssignee: Ravi Sankar <rpenta>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.x   
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-01-24 03:29:28 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:

Description Liang Xia 2013-11-11 10:45:25 UTC
Description of problem:
Given a free user set private_ssl_certificates to true, rhc-admin-ctl-plan failed to detect the inconistent with plans.

Version-Release number of selected component (if applicable):
devenv_4016

How reproducible:
always

Steps to Reproduce:
1.Create a user.
2.Set private_ssl_certificates to true.
3.rhc-admin-ctl-plan --list.
4.rhc-admin-ctl-plan --fix.

Actual results:
Step 3/4 show:
##########################
Users with inconsistent plan:
Total = 0
Skipped = 0
In progress = 0
##########################
Done

Expected results:
The inconsitent should be reported and be fixed.

Additional info:
gears/storage mismatch can be reported and fixed successfully.

Comment 1 Ravi Sankar 2013-11-11 20:51:57 UTC
Fixed in https://github.com/openshift/li/pull/2132

Comment 2 Liang Xia 2013-11-12 03:08:30 UTC
Checked on devenv_4018. Steps and results as below.

1. Add capability to user via oo-admin-ctl-user
2. List the user's capability via oo-admin-ctl-user
3. List the user's capability via rhc-admin-ctl-plan --list -v
4. Fix the user's capability via rhc-admin-ctl-plan --fix -v
5. List the user's capability via rhc-admin-ctl-plan --list -v
6. List the user's capability via oo-admin-ctl-user

Step 2:
# oo-admin-ctl-user -l lxia
User lxia:
                            plan: free
                consumed domains: 1
                     max domains: 3
                  consumed gears: 4
                       max gears: 30
    max tracked storage per gear: 10
  max untracked storage per gear: 0
            plan upgrade enabled: true
                      gear sizes: small, medium
            sub accounts allowed: true
private SSL certificates allowed: true
              inherit gear sizes: true
                      HA allowed: true

Step 3:
# rhc-admin-ctl-plan --list -v
User lxia has more consumed gears(4) than the 'free' plan allows.
User 'lxia' has 'free' plan but has inconsistent capabilities 
##########################
Users with inconsistent plan:
Total = 1
Skipped = 0
In progress = 0
##########################
Done

Step 4:
# rhc-admin-ctl-plan --fix -v
User lxia has more consumed gears(4) than the 'free' plan allows.
User 'lxia' has 'free' plan but has inconsistent capabilities => Failed
##########################
Users with inconsistent plan:
Total = 1
Skipped = 0
In progress = 0
Fixed = 0
Failed = 1
##########################
Done

Step 5:
# rhc-admin-ctl-plan --list -v
User lxia has more consumed gears(4) than the 'free' plan allows.
User 'lxia' has 'free' plan but has inconsistent capabilities 
##########################
Users with inconsistent plan:
Total = 1
Skipped = 0
In progress = 0
##########################
Done

Step 6:
# oo-admin-ctl-user -l lxia
User lxia:
                            plan: free
                consumed domains: 1
                     max domains: 3
                  consumed gears: 4
                       max gears: 30
    max tracked storage per gear: 10
  max untracked storage per gear: 0
            plan upgrade enabled: true
                      gear sizes: small, medium
            sub accounts allowed: true
private SSL certificates allowed: true
              inherit gear sizes: true
                      HA allowed: true

Comment 3 openshift-github-bot 2013-11-12 05:14:38 UTC
Commits pushed to master at https://github.com/openshift/li

https://github.com/openshift/li/commit/6386ac81180d677f1f163d865a665f99c62c72f8
Bug 1028955 - Add missing plan compatibility checks in cloud user model

https://github.com/openshift/li/commit/791c40f25e853d79816a44b969b06eb63eb870f5
Merge pull request #2132 from pravisankar/dev/ravi/bugs1028955_1028337

Merged by openshift-bot

Comment 4 openshift-github-bot 2013-11-12 05:14:44 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/740be12545c0d1da393c346802709d2aeaa0a99e
Merge pull request #4160 from pravisankar/dev/ravi/bugs1028955_1028337

Merged by openshift-bot

Comment 5 Liang Xia 2013-11-13 02:06:59 UTC
Verified on devenv_4025.

# rhc-admin-ctl-plan --list -v
User user_with_certificate_capabilities has private ssl certificates capability mismatch with 'free' plan.
User 'user_with_certificate_capabilities' has 'free' plan but has inconsistent capabilities 

##########################
Users with inconsistent plan:
Total = 1
Skipped = 0
In progress = 0
##########################
Done