From 475a8d89c50fecb0d911acbf6904a255f1471983 Mon Sep 17 00:00:00 2001 From: Russell Haering Date: Tue, 14 Jan 2014 08:44:14 -0800 Subject: [PATCH] update commands to pass advertise_host --- teeth_agent/cmd/decom.py | 20 +++++++++++++++----- teeth_agent/cmd/standby.py | 15 +++++++++++---- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/teeth_agent/cmd/decom.py b/teeth_agent/cmd/decom.py index e95c8791b..7bb1b4d7d 100644 --- a/teeth_agent/cmd/decom.py +++ b/teeth_agent/cmd/decom.py @@ -31,16 +31,22 @@ def run(): parser.add_argument('--listen-host', type=str, help=('The IP address to listen on. Leave this blank' - ' to auto-detect. Even when this is specified,' - ' a public-facing address to advertise will be' - ' auto-detected by establishing a connection to' - ' the agent API.')) + ' to auto-detect. A common use-case would be to' + ' override this with \'localhost\', in order to' + ' run behind a proxy, while leaving' + ' advertise-host unspecified.') parser.add_argument('--listen-port', default=9999, type=int, help='The port to listen on') + parser.add_argument('--advertise-host', + type=str, + help=('The IP address to advertise. Leave this blank' + ' to auto-detect by calling \'getsockname()\' on' + ' a connection to the agent API.')) + parser.add_argument('--advertise-port', type=int, help=('The port to advertise. Defaults to listen-port.' @@ -49,4 +55,8 @@ def run(): args = parser.parse_args() logging.configure() advertise_port = args.advertise_port or args.listen_port - decom.DecomAgent(args.listen_port, advertise_port, args.api_url).run() + decom.DecomAgent(args.listen_host, + args.listen_port, + args.advertise_host, + advertise_port, + args.api_url).run() diff --git a/teeth_agent/cmd/standby.py b/teeth_agent/cmd/standby.py index 3f42fe6fb..e84d798f9 100644 --- a/teeth_agent/cmd/standby.py +++ b/teeth_agent/cmd/standby.py @@ -31,16 +31,22 @@ def run(): parser.add_argument('--listen-host', type=str, help=('The IP address to listen on. Leave this blank' - ' to auto-detect. Even when this is specified,' - ' a public-facing address to advertise will be' - ' auto-detected by establishing a connection to' - ' the agent API.')) + ' to auto-detect. A common use-case would be to' + ' override this with \'localhost\', in order to' + ' run behind a proxy, while leaving' + ' advertise-host unspecified.') parser.add_argument('--listen-port', default=9999, type=int, help='The port to listen on') + parser.add_argument('--advertise-host', + type=str, + help=('The IP address to advertise. Leave this blank' + ' to auto-detect by calling \'getsockname()\' on' + ' a connection to the agent API.')) + parser.add_argument('--advertise-port', type=int, help=('The port to advertise. Defaults to listen-port.' @@ -51,5 +57,6 @@ def run(): advertise_port = args.advertise_port or args.listen_port standby.StandbyAgent(args.listen_host, args.listen_port, + args.advertise_host, advertise_port, args.api_url).run()