From 290c8abeb551532a8da1e02580cd2afbd7ce2eae Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Thu, 20 Nov 2014 15:22:34 -0500 Subject: [PATCH 1/3] Make empty token more readable in logs. Enterprises use "" for tokens. This was confusing to read in the logs without making things more clear by adding quotes around the value. --- buildman/buildcomponent.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildman/buildcomponent.py b/buildman/buildcomponent.py index 59c07042c..6f362fde2 100644 --- a/buildman/buildcomponent.py +++ b/buildman/buildcomponent.py @@ -280,11 +280,11 @@ class BuildComponent(BaseComponent): def _on_ready(self, token): if self._component_status != 'waiting': - LOGGER.warning('Build component with token %s is already connected', self.expected_token) + LOGGER.warning('Build component (token "%s") is already connected', self.expected_token) return if token != self.expected_token: - LOGGER.warning('Builder token mismatch. Expected: %s. Found: %s', self.expected_token, token) + LOGGER.warning('Builder token mismatch. Expected: "%s". Found: "%s"', self.expected_token, token) return self._set_status(ComponentStatus.RUNNING) @@ -339,7 +339,7 @@ class BuildComponent(BaseComponent): def _timeout(self): self._set_status(ComponentStatus.TIMED_OUT) - LOGGER.warning('Build component %s timed out', self.expected_token) + LOGGER.warning('Build component (token "%s") timed out', self.expected_token) self._dispose(timed_out=True) def _dispose(self, timed_out=False): From d2be37dbdeb8b156eb94897bb35351317bb57218 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Thu, 20 Nov 2014 15:25:13 -0500 Subject: [PATCH 2/3] remove shebang from local scripts --- local-run.sh | 2 +- local-test.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/local-run.sh b/local-run.sh index 628873fd7..d606624a7 100755 --- a/local-run.sh +++ b/local-run.sh @@ -1 +1 @@ -gunicorn -c conf/gunicorn_local.py application:application \ No newline at end of file +gunicorn -c conf/gunicorn_local.py application:application \ No newline at end of file diff --git a/local-test.sh b/local-test.sh index c5cb9e283..a54491969 100755 --- a/local-test.sh +++ b/local-test.sh @@ -1,2 +1 @@ -#!/bin/sh TEST=true python -m unittest discover From 872c135205b6b99a8c50459c6cc9ba27c6019347 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Thu, 20 Nov 2014 16:06:23 -0500 Subject: [PATCH 3/3] Make ping method static. Without being static or passing a self parameter, the worker will receive a runtime WAMP error when they attempt to ping during a health check, this marks them unhealthy every single time you attempt a health check. --- buildman/buildcomponent.py | 1 + 1 file changed, 1 insertion(+) diff --git a/buildman/buildcomponent.py b/buildman/buildcomponent.py index 6f362fde2..f47de4022 100644 --- a/buildman/buildcomponent.py +++ b/buildman/buildcomponent.py @@ -274,6 +274,7 @@ class BuildComponent(BaseComponent): # Set the component back to a running state. self._set_status(ComponentStatus.RUNNING) + @staticmethod def _ping(): """ Ping pong. """ return 'pong'