Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
14a6d2ec
Commit
14a6d2ec
authored
Mar 06, 2017
by
Tomek Mrugalski
🛰
Browse files
[5137] Command parameters added
parent
4530c9b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/shell/kea-shell
View file @
14a6d2ec
...
...
@@ -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
:
...
...
src/bin/shell/kea_conn.py
View file @
14a6d2ec
...
...
@@ -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
#
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment