Bug 1013321 - when do app control commands for app2 under app1 repo dir, it actually do operations on app1.
when do app control commands for app2 under app1 repo dir, it actually do ope...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
2.x
Unspecified Unspecified
medium Severity high
: ---
: ---
Assigned To: Clayton Coleman
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-29 05:05 EDT by weiwei jiang
Modified: 2015-05-14 22:25 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-17 09:32:46 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 weiwei jiang 2013-09-29 05:05:41 EDT
Description of problem:
when do app control commands for app2 under app1 repo dir, it actually do operations on app1.

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

How reproducible:
always

Steps to Reproduce:
1.create a app $app1 and git clone the app repo to local dir
2.cd repo dir
3.create another app $app2
4.try to control app2 with -a option
rhc app stop -a app2
rhc app restart -a app2
rhc cartridge add mysql-5.1 -a app2

Actual results:
# rhc app stop -a apps -d
DEBUG: Using config file /root/.openshift/express.conf
DEBUG: Git config 'git config --get rhc.app-id' returned '5247c93a6e0f5d6874000057'
DEBUG: Git config 'git config --get rhc.app-name' returned 'app'
DEBUG: Git config 'git config --get rhc.domain-name' returned 'wjiang'
DEBUG: Authenticating with RHC::Auth::Token
DEBUG: Connecting to https://10.4.59.132/broker/rest/api
DEBUG: Client supports API versions 1.1, 1.2, 1.3, 1.4, 1.5
DEBUG: Using token authentication
DEBUG: Created new httpclient
DEBUG: Request GET https://10.4.59.132/broker/rest/api
DEBUG: SSL Verification failed -- Using self signed cert
DEBUG:    code 200 1194 ms
DEBUG: Server supports API versions 1.0, 1.1, 1.2, 1.3, 1.4
DEBUG:    Using API version 1.4
DEBUG: Client API version 1.4 is not current. Refetching API
DEBUG: Using token authentication
DEBUG: Request GET https://10.4.59.132/broker/rest/api
DEBUG: SSL Verification failed -- Using self signed cert
DEBUG:    code 200 1132 ms
DEBUG: Getting all domains
DEBUG: Using token authentication
DEBUG: Request GET https://10.4.59.132/broker/rest/domains
DEBUG: SSL Verification failed -- Using self signed cert
DEBUG:    code 200 1137 ms
DEBUG: Getting all applications for domain wjiang
DEBUG: Using token authentication
DEBUG: Request GET https://10.4.59.132/broker/rest/domains/wjiang/applications
DEBUG: SSL Verification failed -- Using self signed cert
DEBUG:    code 200 1447 ms
DEBUG: Stopping application app force-false
DEBUG: Using token authentication
DEBUG: Request POST https://10.4.59.132/broker/rest/domains/wjiang/applications/app/events
DEBUG: SSL Verification failed -- Using self signed cert
DEBUG:    code 200 7726 ms
RESULT:
 stopped

Expected results:
It should use the given value instead of `git config`

Additional info:
Comment 1 Clayton Coleman 2013-10-02 10:46:01 EDT
As a consequence of the fix here, 'rhc ssh' will now behave differently.  In a app Git directory, you must run 'rhc ssh -- <command>' or 'rhc app-alias -- <alias>' in order to get the implicit value to work.  This is because it's impossible to know for sure whether the first value is an app name or an alias.
Comment 2 Clayton Coleman 2013-10-02 12:54:57 EDT
https://github.com/openshift/rhc/pull/471
Comment 3 Clayton Coleman 2013-10-02 17:42:51 EDT
Needs a stage pull - didn't make the cut today.
Comment 4 openshift-github-bot 2013-10-03 12:24:32 EDT
Commit pushed to master at https://github.com/openshift/rhc

https://github.com/openshift/rhc/commit/3725348374c05b2a621cf684b9be06cf71738179
Bug 1013321 - Handle implicit arguments more accurately

When both arguments to a command are optional (rhc ssh <app> <command...>), if the user wants to use the default app - the current Git directory, for instance - then they must specify '--' in order to guarantee that <command> isn't confused for <app>.  This commit changes that parsing behavior and cleans up the tests to ensure we are covering that case.
Comment 5 weiwei jiang 2013-10-08 00:45:44 EDT
Tried on INT(devnev_stage_488) and this issue has been fixed. So verified it. Thanks

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