Bug 1035157

Summary: Do app and domain related operation will fail with traceback info when git is not installed
Product: OpenShift Online Reporter: weiwei jiang <wjiang>
Component: ocAssignee: Jordan Liggitt <jliggitt>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: jliggitt, wsun, xiuwang
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-30 00:51:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description weiwei jiang 2013-11-27 07:56:15 UTC
Description of problem:
when git is not installed, do app and domain related operation will fail with traceback info

/usr/local/rvm/gems/ruby-1.9.3-p484/gems/rhc-1.18.0/lib/rhc/git_helpers.rb:50:in ``': No such file or directory - git config --get rhc.app-id (Errno::ENOENT)
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rhc-1.18.0/lib/rhc/git_helpers.rb:50:in `git_config_get'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rhc-1.18.0/lib/rhc/context_helper.rb:104:in `from_local_git'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rhc-1.18.0/lib/rhc/commands.rb:301:in `block in fill_arguments'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rhc-1.18.0/lib/rhc/commands.rb:292:in `each'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rhc-1.18.0/lib/rhc/commands.rb:292:in `fill_arguments'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rhc-1.18.0/lib/rhc/commands.rb:272:in `block (3 levels) in to_commander'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/commander-4.1.5/lib/commander/command.rb:155:in `run'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/commander-4.1.5/lib/commander/runner.rb:400:in `run_active_command'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rhc-1.18.0/lib/rhc/command_runner.rb:73:in `run!'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/commander-4.1.5/lib/commander/delegates.rb:11:in `run!'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rhc-1.18.0/lib/rhc/cli.rb:37:in `start'
        from /usr/bin/rhc:20:in `<main>'

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

How reproducible:
always

Steps to Reproduce:
1.make sure system not install git 
2.run following commands:
rhc app stop|start|restart|show
rhc cartridge add|stop|start|restart|reload|show|status|remove
rhc domain show|delete|configure
3.

Actual results:
Failed with traceback info

/usr/local/rvm/gems/ruby-1.9.3-p484/gems/rhc-1.18.0/lib/rhc/git_helpers.rb:50:in ``': No such file or directory - git config --get rhc.app-id (Errno::ENOENT)
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rhc-1.18.0/lib/rhc/git_helpers.rb:50:in `git_config_get'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rhc-1.18.0/lib/rhc/context_helper.rb:104:in `from_local_git'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rhc-1.18.0/lib/rhc/commands.rb:301:in `block in fill_arguments'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rhc-1.18.0/lib/rhc/commands.rb:292:in `each'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rhc-1.18.0/lib/rhc/commands.rb:292:in `fill_arguments'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rhc-1.18.0/lib/rhc/commands.rb:272:in `block (3 levels) in to_commander'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/commander-4.1.5/lib/commander/command.rb:155:in `run'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/commander-4.1.5/lib/commander/runner.rb:400:in `run_active_command'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rhc-1.18.0/lib/rhc/command_runner.rb:73:in `run!'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/commander-4.1.5/lib/commander/delegates.rb:11:in `run!'
        from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rhc-1.18.0/lib/rhc/cli.rb:37:in `start'
        from /usr/bin/rhc:20:in `<main>'

Expected results:
It should run successfully without error messages.

Additional info:

Comment 1 Jordan Liggitt 2013-11-27 17:41:24 UTC
Will merge in https://github.com/openshift/rhc/pull/516

Comment 2 Wei Sun 2013-11-28 05:56:00 UTC
Will verify this bug after the pull request is merged.

Comment 3 openshift-github-bot 2013-12-02 15:53:25 UTC
Commit pushed to master at https://github.com/openshift/rhc

https://github.com/openshift/rhc/commit/585d2abfbfbe70d35ea1edcbb481214eddc0fb25
Fix bug 1035157: Test for git

Skip clone during create if unavailable

Check for git before cloning

Comment 4 weiwei jiang 2013-12-03 11:06:58 UTC
Tried on devenv_4087 with rhc build from it, and can not reproduce this bug, so verify this issue.