File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -403,9 +403,6 @@ def _get_scheduler(self):
403403 _scheduler = property (_get_scheduler )
404404
405405 def _get_command (self ):
406- # handle special case for Dockerfile deployments
407- if self .type == 'cmd' :
408- return ''
409406 try :
410407 # if this is not procfile-based app, ensure they cannot break out
411408 # and run arbitrary commands on the host
@@ -415,8 +412,9 @@ def _get_command(self):
415412 else :
416413 return 'start {}' .format (self .type )
417414 # if the key is not present or if a parent attribute is None
418- except (KeyError , TypeError ):
419- return 'start {}' .format (self .type )
415+ except (KeyError , TypeError , AttributeError ):
416+ # handle special case for Dockerfile deployments
417+ return '' if self .type == 'cmd' else 'start {}' .format (self .type )
420418
421419 _command = property (_get_command )
422420
Original file line number Diff line number Diff line change @@ -488,13 +488,16 @@ def test_command_good(self):
488488 build .sha = 'european-swallow'
489489 build .dockerfile = 'dockerdockerdocker'
490490 self .assertEqual (c ._command , "bash -c 'node server.js'" )
491+ c .type = 'cmd'
492+ self .assertEqual (c ._command , '' )
493+ # ensure we can override the cmd process type in a Procfile
494+ build .procfile ['cmd' ] = 'node server.js'
495+ self .assertEqual (c ._command , "bash -c 'node server.js'" )
491496 c .type = 'worker'
492497 self .assertEqual (c ._command , "bash -c 'node worker.js'" )
493498 c .release .build .procfile = None
494499 # for backwards compatibility if no Procfile is supplied
495500 self .assertEqual (c ._command , 'start worker' )
496- c .type = 'cmd'
497- self .assertEqual (c ._command , '' )
498501
499502 def test_run_command_good (self ):
500503 """Test the run command for each container workflow"""
You can’t perform that action at this time.
0 commit comments