From 5d54cadaaf2386d6c2f7a770e014734457780908 Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Wed, 20 Apr 2016 11:25:55 +0100 Subject: [PATCH] forward port # api command --- etc/exabgp/processes/tcp-server | 2 +- lib/exabgp/reactor/api/api.py | 1 + lib/exabgp/reactor/api/command/text.py | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/etc/exabgp/processes/tcp-server b/etc/exabgp/processes/tcp-server index ea5086bbb..ac152832a 100755 --- a/etc/exabgp/processes/tcp-server +++ b/etc/exabgp/processes/tcp-server @@ -118,7 +118,7 @@ class Control (StreamRequestHandler): self.wfile.flush() prompt = True - elif command in ['shutdown','reload','restart','version']: + elif command in ['shutdown','reload','restart','version','#']: sys.stdout.write('%s\n' % command) sys.stdout.flush() prompt = True diff --git a/lib/exabgp/reactor/api/api.py b/lib/exabgp/reactor/api/api.py index 5440b0959..31c89b47e 100644 --- a/lib/exabgp/reactor/api/api.py +++ b/lib/exabgp/reactor/api/api.py @@ -46,6 +46,7 @@ class API (object): 'restart', 'reload', 'shutdown', + '#', ],reverse=True) def __init__ (self,reactor): diff --git a/lib/exabgp/reactor/api/command/text.py b/lib/exabgp/reactor/api/command/text.py index debae749b..349c3e7ad 100644 --- a/lib/exabgp/reactor/api/command/text.py +++ b/lib/exabgp/reactor/api/command/text.py @@ -45,6 +45,12 @@ def version (self, reactor, service, command): return True +@Text('#') +def version (self, reactor, service, command): + self.logger.processes(command.lstrip().lstrip('#').strip()) + return True + + @Text('teardown') def teardown (self, reactor, service, command): try: