Skip to content

Commit 9bb3638

Browse files
author
Gabriel Monroy
committed
add run_list and initial_attributes conditionally
1 parent d6ee9e9 commit 9bb3638

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

api/models.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,10 @@ def _prepare_launch_args(self):
537537
chef['validation_name'] = settings.CHEF_VALIDATION_NAME
538538
chef['validation_key'] = settings.CHEF_VALIDATION_KEY
539539
chef['node_name'] = self.id
540-
# use the layer's run list
541-
chef['run_list'] = self.layer.run_list
542-
chef['initial_attributes'] = self.layer.initial_attributes
540+
if self.layer.run_list:
541+
chef['run_list'] = self.layer.run_list
542+
if self.layer.initial_attributes:
543+
chef['initial_attributes'] = self.layer.initial_attributes
543544
# add the formation's ssh pubkey
544545
init.setdefault('ssh_authorized_keys', []).append(
545546
self.formation.ssh_public_key)

0 commit comments

Comments
 (0)