Skip to content

Commit 5dc2abe

Browse files
author
Matthew Fisher
committed
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.
1 parent 0f6761e commit 5dc2abe

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

client/deis.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -460,16 +460,16 @@ def apps_create(self, args):
460460
# TODO: retrieve the hostname from service discovery
461461
hostname = urlparse.urlparse(self._settings['controller']).netloc.split(':')[0]
462462
git_remote = "ssh://git@{hostname}:2222/{app_id}.git".format(**locals())
463-
try:
464-
if args.get('--no-remote'):
465-
print('remote available at {}'.format(git_remote))
466-
else:
463+
if args.get('--no-remote'):
464+
print('remote available at {}'.format(git_remote))
465+
else:
466+
try:
467467
subprocess.check_call(
468468
['git', 'remote', 'add', '-f', 'deis', git_remote],
469469
stdout=subprocess.PIPE)
470-
except subprocess.CalledProcessError:
471-
sys.exit(1)
472-
print('Git remote deis added')
470+
print('Git remote deis added')
471+
except subprocess.CalledProcessError:
472+
sys.exit(1)
473473
else:
474474
raise ResponseError(response)
475475

0 commit comments

Comments
 (0)