Bug 1279584 - Users have nil value for resulting in failed oo-admin-repair
Users have nil value for resulting in failed oo-admin-repair
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
2.2.0
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Rory Thrasher
Wei Sun
:
Depends On: 1272568
Blocks: 1273542
  Show dependency treegraph
 
Reported: 2015-11-09 14:36 EST by Ryan Howe
Modified: 2016-03-28 13:55 EDT (History)
10 users (show)

See Also:
Fixed In Version: rubygem-openshift-origin-controller-1.38.5.1-1.el6op
Doc Type: Bug Fix
Doc Text:
There were certain situations when a user could have a plan_id that that didn't have a defined plan in the get_plan function. This would cause oo-admin-repair and oo-admin-chk to error out. There is now a check to see if the plan is defined, and if it fails then a default plan will be used. Oo-admin-repair and oo-admin-chk will no longer error out in this situation, and will provide a warning (but not a failure) that there is a plan_id with a plan that hasn't been defined.
Story Points: ---
Clone Of: 1272568
Environment:
Last Closed: 2016-03-22 12:51:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:0489 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 2.2.9 security, bug fix, and enhancement update 2016-03-22 16:49:04 EDT

  None (edit)
Comment 16 openshift-github-bot 2016-01-15 17:56:32 EST
Commits pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/65f72bd7c6b022a6211c80670c2b40934f0802ec
admin_helper.rb: check for nil plans

Bug 1279584
BZ https://bugzilla.redhat.com/show_bug.cgi?id=1279584

In situations where get_plans returns nil when trying to determine user
capabilities, attempting to populate_user_hash in oo-admin-chk and
oo-admin-repair would result in the script crashing due to an undefined method
exception.  The script will now check if get_plans comes back nil and will drop
back to using the default user capabilities, as well as displaying a warning
that plans will not be used.  This warning will not cause
oo-admin-chk or oo-admin-repair to fail.

https://github.com/openshift/origin-server/commit/cf252f41f6a5ecd58a178a2f1b8956ba78969043
Merge pull request #6348 from thrasher-redhat/bug1279584

Merged by openshift-bot
Comment 20 Rory Thrasher 2016-02-22 17:20:24 EST
QE,

Can we test that oo-admin-chk will no longer fail when a user has a plan_id that has not been defined by the billing plugin's get_plans?


1. Create a user with a plan_id of 'foo'
2. Run oo-admin-chk

oo-admin-chk should not fail, and should print "Warning: At least one user has a plan id defined, but no plans could be found. Plan-defined user capabilities will not be considered."


Puddle:http://etherpad.corp.redhat.com/puddle-2-2-2016-02-19

Thank you
Comment 21 Johnny Liu 2016-02-29 02:37:37 EST
Verified this bug with rubygem-openshift-origin-controller-1.38.5.1-1.el6op.noarch, and PASS.


# oo-admin-ctl-user -l jialiu --setplan na

# oo-admin-repair --consumed-gears
Started at: 2016-02-29 07:35:24 UTC
Warning: At least one user has a plan id defined, but no plans could be found. Plan-defined user capabilities will not be considered.


Finished at: 2016-02-29 07:35:24 UTC
Total time: 0.014s
SUCCESS


# oo-admin-chk 
Started at: 2016-02-29 07:37:05 UTC

Warning: At least one user has a plan id defined, but no plans could be found. Plan-defined user capabilities will not be considered.
User data populated in 0 seconds

Domain data populated in 0 seconds

District data populated in 0 seconds

Total gears found in mongo: 2
Application data populated in 0 seconds

Usage data populated in 0 seconds

Fetched all gears in 20 seconds
Total gears found on the nodes: 2
Total nodes that responded: 1
Checked application gears on nodes in 0 seconds

Checked application gears on nodes (reverse match) in 0 seconds


Finished at: 2016-02-29 07:37:25 UTC
Total time: 20.554s
SUCCESS
Comment 24 errata-xmlrpc 2016-03-22 12:51:23 EDT
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://rhn.redhat.com/errata/RHSA-2016-0489.html

Note You need to log in before you can comment on or make changes to this bug.