Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
415
Issues
415
List
Boards
Labels
Service Desk
Milestones
Merge Requests
67
Merge Requests
67
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
Kea
Commits
14a6d2ec
Commit
14a6d2ec
authored
Mar 06, 2017
by
Tomek Mrugalski
🛰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[5137] Command parameters added
parent
4530c9b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
src/bin/shell/kea-shell
src/bin/shell/kea-shell
+7
-0
src/bin/shell/kea_conn.py
src/bin/shell/kea_conn.py
+5
-1
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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