Skip to content

Commit 8b21c26

Browse files
author
Matthew Fisher
committed
ref(controller): remove initial from .deploy()
initial is only equal to the time when the structure has no values and a build is present, so it makes no sense to check for initial in any other case.
1 parent 3c35dce commit 8b21c26

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

controller/api/models.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def _destroy_containers(self, to_destroy):
327327
log_event(self, err, logging.ERROR)
328328
raise RuntimeError(err)
329329

330-
def deploy(self, user, release, initial=False):
330+
def deploy(self, user, release):
331331
"""Deploy a new release to this application"""
332332
existing = self.container_set.exclude(type='run')
333333
new = []
@@ -343,7 +343,7 @@ def deploy(self, user, release, initial=False):
343343
self._destroy_containers(existing)
344344

345345
# perform default scaling if necessary
346-
if initial:
346+
if self.structure == {} and release.build is not None:
347347
self._default_scale(user, release)
348348

349349
def _default_scale(self, user, release):
@@ -602,9 +602,8 @@ def create(self, user, *args, **kwargs):
602602
build=self,
603603
config=latest_release.config,
604604
source_version=source_version)
605-
initial = True if self.app.structure == {} else False
606605
try:
607-
self.app.deploy(user, new_release, initial=initial)
606+
self.app.deploy(user, new_release)
608607
return new_release
609608
except RuntimeError:
610609
new_release.delete()

0 commit comments

Comments
 (0)