Bug 985218 - KeyError when erase a non-exist cartridge by oo-admin-cartridge
KeyError when erase a non-exist cartridge by oo-admin-cartridge
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Michal Fojtik
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-17 02:40 EDT by Yan Du
Modified: 2015-05-14 19:24 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-29 08:48:18 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)

  None (edit)
Description Yan Du 2013-07-17 02:40:12 EDT
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 10:03:41 EDT
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-14 23:59:52 EDT
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.