Bug 977293 - admin tool oo-idler-stats with option --validate shown all app type as unknown.
Summary: admin tool oo-idler-stats with option --validate shown all app type as unknown.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Jason DeTiberus
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-24 08:56 UTC by Liang Xia
Modified: 2015-05-14 23:22 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-07 22:54:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Liang Xia 2013-06-24 08:56:36 UTC
Description of problem:
Command "oo-idler-stats  --validate" shown all app type as unknown.
Version-Release number of selected component (if applicable):
devenv_3405
How reproducible:
always
Steps to Reproduce:
1.create some apps.
2.ssh into instance and run command "oo-idler-stats  --validate"
3.check the output.
Actual results:
All app type shown unknown as below:
# oo-idler-stats  --validate
Validation for uid 504 (fef8a12adc7b11e2ba3a22000a893e2f): 
    Last updated: Jun 23 2013 (0 days ago)
    app5 (unknown) seems okay.
Validation for uid 502 (248678121169238628499456): 
    Last updated: Jun 23 2013 (0 days ago)
    app3 (unknown) seems okay.
Validation for uid 503 (51c7b9351d4f810a34000002): 
    Last updated: Jun 23 2013 (0 days ago)
    app4 (unknown) seems okay.
Validation for uid 501 (51c7b8f81d4f810a34000001): 
    Last updated: Jun 23 2013 (0 days ago)
    app1 (unknown) seems okay.
4 running, 0 idled, 0 half-idled for a total 4 of 4 (100.00 %)
Expected results:
Should show  the correct app type.
Additional info:
It seems that get_app_type method definition is incorrect.

Comment 1 Meng Bo 2013-06-24 09:04:31 UTC
There is also another minor issue (or typo) in the script oo-idler-state in the validate definition.

When run the oo-idler-state --validate with git/ dir missing.

155     # Is there a /git directory?
156     if not os.path.isdir(app_path+"/git"):
157         return "Path /var/openshift/%s/git not found." % uuid
                           ^^^^^^^^^^
                Should be /var/lib/openshift here


The issue is too minor to report a bug separately... 
Please fix the output incidentally.

Comment 2 openshift-github-bot 2013-07-25 20:22:28 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/e218a116ff01b1f8065dd95dd8cc7e63401c2e9e
<oo-idler-stats> Bug 977293 - Fix get_app_type for v2 carts

https://bugzilla.redhat.com/show_bug.cgi?id=977293

get_app_type was trying to match against v1 cartridge paths, updated to
test for correct v2 paths.

Comment 3 Liang Xia 2013-07-29 05:49:13 UTC
Verified on devenv_3572.

# oo-idler-stats  --validate
Validation for uid 502 (756336227430956351356928): 
    Last updated: Jul 29 2013 (0 days ago)
    app2 (jbossews) seems okay.

Validation for uid 501 (8c3b7c6af81011e2b09122000ab30e1f): 
    Last updated: Jul 29 2013 (0 days ago)
    app1 (php) seems okay.

2 running, 0 idled, 0 half-idled for a total 2 of 2 (100.00 %)


And problem in comment #1 also fixed.
def validate(uuid):
    ''' given a user's uuid, verify an app exists. '''
    app_path = "/var/lib/openshift/%s" % uuid

    # Is there a /git directory?
    if not os.path.isdir(app_path+"/git"):
        return "Path %s/git not found." % app_path

    # Is there something inside the /git directory?
    dirs = os.listdir(app_path+"/git")
    if len(dirs) == 0:
        return "Path %s/git is empty." % app_path


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