summaryrefslogtreecommitdiffstats
path: root/src/ogClient.py
diff options
context:
space:
mode:
authorAlvaro Neira Ayuso <aneira@soleta.eu>2019-12-27 13:46:49 +0100
committerAlvaro Neira Ayuso <alvaroneay@gmail.com>2020-01-19 19:50:44 +0100
commite20daf639dd271268b172b42adc0d1b9d2103883 (patch)
treeaa9a27298d6a8b88d2a9d1364c5ab8afe00ea780 /src/ogClient.py
parentdfc97ffedb9a356299b593f76ce057f5953a77ab (diff)
Add shell run and output commands
Opengnsys needs a support to execute commands on the machine. This patch adds the support for executing two new commands "shell/run" and "shell/output". The first one, give us the support for executing a command in the machine and keep save in a queue the output. The second one, give us the support for sending the output from the command executed.
Diffstat (limited to 'src/ogClient.py')
-rw-r--r--src/ogClient.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ogClient.py b/src/ogClient.py
index fb87bac..6aceeaa 100644
--- a/src/ogClient.py
+++ b/src/ogClient.py
@@ -18,6 +18,7 @@ class ogClient:
def __init__(self, ip, port):
self.ip = ip
self.port = port
+ self.ogrest = ogRest()
def get_socket(self):
return self.sock
@@ -74,7 +75,6 @@ class ogClient:
self.data = self.data + data
httpparser = HTTPParser()
- ogrest = ogRest()
if not self.trailer:
if self.data.find("\r\n") > 0:
@@ -89,7 +89,7 @@ class ogClient:
if self.trailer and len(self.data) >= self.content_len:
httpparser.parser(self.data)
- ogrest.processOperation(httpparser.getRequestOP(), httpparser.getURI(), self)
+ self.ogrest.processOperation(httpparser.getRequestOP(), httpparser.getURI(), httpparser.getCMD(), self)
# Cleanup state information from request
self.data = ""