Created
August 6, 2012 19:36
-
-
Save alq666/3277858 to your computer and use it in GitHub Desktop.
Fixes invalid port type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ddagent.py b/ddagent.py | |
index fb3f50d..79ac59d 100755 | |
--- a/ddagent.py | |
+++ b/ddagent.py | |
@@ -182,7 +182,7 @@ class ApiInputHandler(tornado.web.RequestHandler): | |
class Application(tornado.web.Application): | |
def __init__(self, port, agentConfig): | |
- self._port = port | |
+ self._port = int(port) | |
self._agentConfig = agentConfig | |
self._metrics = {} | |
self._watchdog = Watchdog(TRANSACTION_FLUSH_INTERVAL * WATCHDOG_INTERVAL_MULTIPLIER) | |
@@ -227,7 +227,7 @@ class Application(tornado.web.Application): | |
tornado.web.Application.__init__(self, handlers, **settings) | |
http_server = tornado.httpserver.HTTPServer(self) | |
http_server.listen(self._port) | |
- logging.info("Listening on port %s" % self._port) | |
+ logging.info("Listening on port %d" % self._port) | |
# Register callbacks | |
mloop = tornado.ioloop.IOLoop.instance() | |
@@ -263,13 +263,14 @@ def main(): | |
agentConfig = get_config(parse_args = False) | |
- port = agentConfig.get('listen_port', None) | |
+ port = agentConfig.get('listen_port', 17123) | |
if port is None: | |
port = 17123 | |
+ else: | |
+ port = int(port) | |
app = Application(port, agentConfig) | |
app.run() | |
if __name__ == "__main__": | |
main() | |
- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to apply:
If the patch fails,
-p1
should do the trick (yes all computer bugs are off-by-ones :)