Skip to content

Commit b5d515d

Browse files
author
Gabriel Monroy
committed
add default run_lists to layers:create
1 parent 45d327a commit b5d515d

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

client/deis/client.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
""",
123123
'keys:remove': """Usage: deis keys:remove <key>
124124
""",
125-
'layers:create': """Usage: deis layers:create <id> <flavor> --run_list=<run_list> [options]
125+
'layers:create': """Usage: deis layers:create <id> <flavor> [options]
126126
127127
Chef Options:
128128
@@ -700,12 +700,18 @@ def layers_create(self, args):
700700
formation = args.get('--formation')
701701
if not formation:
702702
formation = self._session.formation
703-
body = {'id': args['<id>'], 'flavor': args['<flavor>'], 'run_list': args['--run_list']}
704-
for opt in ('--environment', '--initial_attributes',
703+
body = {'id': args['<id>'], 'flavor': args['<flavor>']}
704+
for opt in ('--environment', '--initial_attributes', '--run_list',
705705
'--ssh_username', '--ssh_private_key', '--ssh_public_key'):
706706
o = args.get(opt)
707707
if o:
708708
body.update({opt.strip('-'): o})
709+
# provide default run_list for runtime and proxy
710+
if not 'run_list' in body:
711+
if body['id'] == 'runtime':
712+
body['run_list'] = 'recipe[deis],recipe[deis::runtime]'
713+
elif body['id'] == 'proxy':
714+
body['run_list'] = 'recipe[deis],recipe[deis::proxy]'
709715
sys.stdout.write('Creating {} layer... '.format(args['<id>']))
710716
sys.stdout.flush()
711717
response = self._dispatch('post', '/api/formations/{}/layers'.format(formation),

0 commit comments

Comments
 (0)