Skip to content

Commit e35c458

Browse files
author
Matthew Fisher
committed
ref(client): use docopt to handle default remote name
1 parent 61c8755 commit e35c458

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

client/deis.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,8 @@ def apps_create(self, args):
438438
-b --buildpack BUILDPACK
439439
a buildpack url to use for this app
440440
441-
-r --remote REMOTE
442-
name of remote to create, default 'deis'
441+
-r --remote REMOTE
442+
name of remote to create. [default: deis]
443443
"""
444444
body = {}
445445
app_name = None
@@ -476,10 +476,7 @@ def apps_create(self, args):
476476
git_remote = "ssh://git@{hostname}:2222/{app_id}.git".format(**locals())
477477
self._logger.info('remote available at {}'.format(git_remote))
478478
else:
479-
remote_name = args.get('--remote')
480-
if not remote_name:
481-
remote_name = 'deis'
482-
self._git_remote_create(app_id, remote_name)
479+
self._git_remote_create(app_id, args.get('--remote'))
483480

484481
def apps_destroy(self, args):
485482
"""
@@ -1288,19 +1285,16 @@ def git_remote(self, args):
12881285
-a --app=<app>
12891286
the uniquely identifiable name for the application.
12901287
1291-
-r --remote REMOTE
1292-
name of remote to create, default 'deis'
1288+
-r --remote REMOTE
1289+
name of remote to create. [default: deis]
12931290
"""
12941291
app = args.get('--app')
12951292
if not app:
12961293
app = self._session.app
12971294
response = self._dispatch(
12981295
'get', "/v1/apps/{app}/domains".format(app=app))
12991296
if response.status_code == requests.codes.ok:
1300-
remote_name = args.get('--remote')
1301-
if not remote_name:
1302-
remote_name = 'deis'
1303-
self._git_remote_create(app, remote_name)
1297+
self._git_remote_create(app, args.get('--remote'))
13041298
else:
13051299
raise ResponseError(response)
13061300

0 commit comments

Comments
 (0)