Skip to content

Commit 3f2cc54

Browse files
author
Matthew Fisher
committed
Merge pull request #4185 from bacongobbler/controller-enhancements
ref(controller): code quality enhancements
2 parents 05afd5c + 7f02dcc commit 3f2cc54

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

controller/api/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ def _healthcheck(self, containers, config):
381381
# HACK (bacongobbler): we need to wait until publisher has a chance to publish each
382382
# service to etcd, which can take up to 20 seconds.
383383
time.sleep(20)
384-
for i in range(0, 4):
384+
for i in xrange(len(intervals)):
385385
delay = int(config.get('HEALTHCHECK_INITIAL_DELAY', 0))
386386
try:
387387
# sleep until the initial timeout is over
@@ -391,8 +391,8 @@ def _healthcheck(self, containers, config):
391391
break
392392
except exceptions.HealthcheckException as e:
393393
try:
394-
new_delay = delay * intervals[i+1]
395-
msg = "{}; trying again in {} seconds".format(e, new_delay)
394+
next_delay = delay * intervals[i+1]
395+
msg = "{}; trying again in {} seconds".format(e, next_delay)
396396
log_event(self, msg, logging.WARNING)
397397
except IndexError:
398398
log_event(self, e, logging.WARNING)

controller/api/tests/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ def test_unauthorized_user_cannot_modify_config(self):
540540
HTTP_AUTHORIZATION='token {}'.format(unauthorized_token))
541541
self.assertEqual(response.status_code, 403)
542542

543-
def _test_app_healthcheck(self,):
543+
def _test_app_healthcheck(self):
544544
# post a new build, expecting it to pass as usual
545545
url = "/v1/apps/{self.app}/builds".format(**locals())
546546
body = {'image': 'autotest/example'}

0 commit comments

Comments
 (0)