diff --git a/src/bin/shell/kea-shell b/src/bin/shell/kea-shell index 62fccfcc092e13cab5e06b0c0ed714a1b0db12e2..b24d4a61bdb001b8efafc08b82ae9041a5a6a967 100644 --- a/src/bin/shell/kea-shell +++ b/src/bin/shell/kea-shell @@ -50,6 +50,13 @@ params.generateHeaders() conn = kea_connector.KeaConnector() +# Load command processor +# @todo + +# Read parameters from stdin (they're optional for some commands) +for line in sys.stdin: + params.params += line + try: resp = conn.sendCA(params) except Exception as e: diff --git a/src/bin/shell/kea_conn.py b/src/bin/shell/kea_conn.py index c1fb2dc5aa412ca5f15da9c17e5f73c851345217..d7791469c7436ab4eae995f2affdd109bf75d2f5 100644 --- a/src/bin/shell/kea_conn.py +++ b/src/bin/shell/kea_conn.py @@ -16,6 +16,7 @@ class CARequest: http_port = 0 command = '' timeout = 0 + params = '' headers = {} # Generates the content, out of specified command line @@ -23,7 +24,10 @@ class CARequest: # @todo: Add support for parameters # this stores the output in self.content def generateBody(self): - self.content = '{"command": "' + self.command + '"}' + self.content = '{ "command": "' + self.command + '" ' + if (len(self.params)): + self.content += self.params + self.content += '}' # Generate HTTP headers #