Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
refactor(client): fix program flow of --no-remote
If you specified --no-remote, "git remote deis added" would still
be displayed. This moves that logic into the try/catch block so it
will only be printed if it hits there.
  • Loading branch information
Matthew Fisher committed Apr 17, 2014
1 parent 0f6761e commit 5dc2abe
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions client/deis.py
Expand Up @@ -460,16 +460,16 @@ def apps_create(self, args):
# TODO: retrieve the hostname from service discovery
hostname = urlparse.urlparse(self._settings['controller']).netloc.split(':')[0]
git_remote = "ssh://git@{hostname}:2222/{app_id}.git".format(**locals())
try:
if args.get('--no-remote'):
print('remote available at {}'.format(git_remote))
else:
if args.get('--no-remote'):
print('remote available at {}'.format(git_remote))
else:
try:
subprocess.check_call(
['git', 'remote', 'add', '-f', 'deis', git_remote],
stdout=subprocess.PIPE)
except subprocess.CalledProcessError:
sys.exit(1)
print('Git remote deis added')
print('Git remote deis added')
except subprocess.CalledProcessError:
sys.exit(1)
else:
raise ResponseError(response)

Expand Down

0 comments on commit 5dc2abe

Please sign in to comment.