Bug 985218 - KeyError when erase a non-exist cartridge by oo-admin-cartridge
Summary: KeyError when erase a non-exist cartridge by oo-admin-cartridge
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Michal Fojtik
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-17 06:40 UTC by Yan Du
Modified: 2015-05-14 23:24 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-29 12:48:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Yan Du 2013-07-17 06:40:12 UTC
Description of problem:
Using oo-admin-cartridge to erase a non-exist cartridge

[root@ip-10-164-13-112 ~]# oo-admin-cartridge -a erase -n zend -v 5.7 -c 0.0.1
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.12.1/lib/openshift-origin-node/model/cartridge_repository.rb:199:in `erase': key not found: (zend, 5.7, 0.0.1) (KeyError)
    from /usr/sbin/oo-admin-cartridge:50:in `apply'
    from /usr/sbin/oo-admin-cartridge:134:in `<main>'



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



How reproducible:
Always


Steps to Reproduce:
1. erase a non-exist cartridge
   oo-admin-cartridge -a erase -n zend -v 5.7 -c 0.0.1


Actual results:
[root@ip-10-164-13-112 ~]# oo-admin-cartridge -a erase -n zend -v 5.7 -c 0.0.1
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.12.1/lib/openshift-origin-node/model/cartridge_repository.rb:199:in `erase': key not found: (zend, 5.7, 0.0.1) (KeyError)
    from /usr/sbin/oo-admin-cartridge:50:in `apply'
    from /usr/sbin/oo-admin-cartridge:134:in `<main>'



Expected results:
no error show. just a friendly message display, like the cartrdige doesn't exist.

Comment 1 Michal Fojtik 2013-08-14 14:03:41 UTC
Hi Yan,

I made a pull request with fix for this bug:

https://github.com/openshift/origin-server/pull/3353

Please let me know if it works for you :-)

Comment 2 Yan Du 2013-08-15 03:59:52 UTC
test on devenv_3653

[root@ip-10-164-87-105 ~]# oo-admin-cartridge -a erase -n zend -v 5.7 -c 0.0.1
requested cartridge does not exists (key not found: (zend, 5.7, 0.0.1))

error doesn't show up when erase a non-exist cartridge. move the bug to verified. Thanks.


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