File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -401,15 +401,13 @@ def _get_scheduler(self):
401401 _scheduler = property (_get_scheduler )
402402
403403 def _get_command (self ):
404- # handle special case for Dockerfile deployments
405- if self .type == 'cmd' :
406- return ''
407404 try :
408405 # ensure they cannot break out and run commands on the host
409406 return "bash -c '{}'" .format (self .release .build .procfile [self .type ])
410407 # if the key is not present or if a parent attribute is None
411- except (KeyError , TypeError ):
412- return 'start {}' .format (self .type )
408+ except (KeyError , TypeError , AttributeError ):
409+ # handle special case for Dockerfile deployments
410+ return '' if self .type == 'cmd' else 'start {}' .format (self .type )
413411
414412 _command = property (_get_command )
415413
Original file line number Diff line number Diff line change @@ -462,12 +462,15 @@ def test_command_good(self):
462462 type = 'web' ,
463463 num = 1 )
464464 self .assertEqual (c ._command , "bash -c 'node server.js'" )
465+ c .type = 'cmd'
466+ self .assertEqual (c ._command , '' )
467+ # ensure we can override the cmd process type in a Procfile
468+ build .procfile ['cmd' ] = 'node server.js'
469+ self .assertEqual (c ._command , "bash -c 'node server.js'" )
465470 c .type = 'worker'
466471 self .assertEqual (c ._command , "bash -c 'node worker.js'" )
467472 c .release .build .procfile = None
468473 self .assertEqual (c ._command , 'start worker' )
469- c .type = 'cmd'
470- self .assertEqual (c ._command , '' )
471474
472475 def test_run_command_good (self ):
473476 """Test the run command for each container workflow"""
You can’t perform that action at this time.
0 commit comments