Bug 1034141 - Failed to detect the subaccount which has applications by rhc-admin-delete-subaccounts
Summary: Failed to detect the subaccount which has applications by rhc-admin-delete-su...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Pod
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Ravi Sankar
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-25 10:32 UTC by chunchen
Modified: 2016-09-30 02:15 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-30 00:50:50 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description chunchen 2013-11-25 10:32:12 UTC
Description of problem:
It's failed to detect the subaccount which has applications with its 'updated_at' field in mongodb also is one week ago by rhc-admin-delete-subaccounts.

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

How reproducible:
always

Steps to Reproduce:
1. Add capacity to your rhlogin
oo-admin-ctl-user -l $user --allowsubaccount true --inheritgearsize true --addgearsize c9

2. Create a subaccount
curl -k -X POST -H 'Accept: application/xml' -H 'X-Impersonate-User: $subaccount' -d id=$subdomain --user $user:$password https://ec2-50-17-83-185.compute-1.amazonaws.com/broker/rest/domains

3. Create an application as subaccount
curl -k -X POST -H 'Accept: application/xml' -H 'X-Impersonate-User: $subaccount' -d name=c1 -d cartridge=php-5.3 -d gear_profile=c9 --user $user:$password https://ec2-50-17-83-185.compute-1.amazonaws.com/broker/rest/domains/$subdomain/applications

4. Update the value of 'updated_at' of the subaccount to a week ago in mongo
# mongo openshift_broker_dev
> db.cloud_users.update({"login":"$subaccount"},{$set:{"updated_at":"$time"}})
for example:
db.cloud_users.update({"login":"c9sub"},{$set:{"updated_at":ISODate("2013-06-01T02:46:45.185Z")}})

5. On broker, run oo-admin-delete-subaccounts
rhc-admin-delete-subaccounts -l $user  -v

Actual results:
Summary of one week old subaccounts for user 'chunchen':
	Total       : 0
	Deleted     : 0
	Failed      : 0
	Unprocessed : 0

SUCCESS

Expected results:
Should detect the subaccount even if it has applications by rhc-admin-delete-subaccounts

Additional info:

Comment 1 Ravi Sankar 2013-12-02 21:11:27 UTC
Fixed in https://github.com/openshift/li/pull/2199

Output will be the same, minor change in the wording. Now it will say:
"Summary of one week old subaccounts without any applications for user <user-name>:"

Comment 2 openshift-github-bot 2013-12-03 00:20:58 UTC
Commits pushed to master at https://github.com/openshift/li

https://github.com/openshift/li/commit/79055e608cf284db36c62cb30503e57a54237932
Bug 1034141 - Minor wording change in rhc-admin-delete-subaccounts script

https://github.com/openshift/li/commit/b1989e43f1dc581b1f0db2ccd8154aba6b7e2328
Merge pull request #2199 from pravisankar/dev/ravi/bug1034141

Merged by openshift-bot

Comment 3 Jianwei Hou 2013-12-03 11:36:40 UTC
Verified on devenv_4084
Message is now updated, Steps are as bug description.

[root@ip-10-243-34-113 ~]# rhc-admin-delete-subaccounts -l jhou  -v

Summary of one week old subaccounts without any applications for user 'jhou':
	Total       : 0
	Deleted     : 0
	Failed      : 0
	Unprocessed : 0

SUCCESS


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