summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Handle scripts that end in \rRoberto Hueso Gómez2020-02-251-1/+1
|
* Modify way to close PID processAlvaro Neira Ayuso2020-02-241-12/+17
| | | | | | With our client disconnection, we hid that the ogClient process will be closed too. This new way only close the subprocess keeping the ogClient still working.
* Use state machine to avoid race condition problemsAlvaro Neira Ayuso2020-02-231-11/+63
| | | | | | This patch allows us to control the thread using a state machine. This state machine controls if the client is busy or not. This new way to control the threads give us more control for avoiding race condition problems.
* remove unused gettersOpenGnSys Support Team2020-02-211-18/+0
|
* pep-0008 cleanupOpenGnSys Support Team2020-02-212-43/+43
| | | | | | | From pep-0008: Method Names and Instance Variables Use the function naming rules: lowercase with words separated by underscores as necessary to improve readability.
* Use 'bash' as the default shell for operations scriptsRoberto Hueso Gómez2020-02-091-12/+28
|
* Use 'with' keyword for file readingRoberto Hueso Gómez2020-02-051-9/+4
| | | | | | This is applied to /software and /hardware file reads. We should use 'with' instead of opening and closing a file since this prevents that files stay open after an exception is raised.
* Use python f-strings for commands compositionRoberto Hueso Gómez2020-02-051-14/+13
|
* Fix /session executionRoberto Hueso Gómez2020-02-051-1/+4
| | | | The script now reads arguments correctly.
* Fix /image/restore execution and responseRoberto Hueso Gómez2020-02-052-1/+10
|
* Fix /image/create execution and responseRoberto Hueso Gómez2020-02-052-7/+12
|
* (BUG) Rename OG_SCRIPT_PATH to OG_PATHAlvaro Neira Ayuso2020-02-041-2/+2
|
* Fix /setup execution and responseRoberto Hueso Gómez2020-02-032-16/+17
|
* Fix parseGetConf(...) configuration parsingRoberto Hueso Gómez2020-02-033-27/+29
| | | | This patch also reformats the response to the /refresh command.
* add space after Content-Length and Content-TypeOpenGnSys Support Team2020-01-281-2/+2
| | | | ogAdmServer needs this space to work fine.
* Change POST /refresh to GET /refreshRoberto Hueso Gómez2020-01-212-6/+6
| | | | | This patch changes the HTTP method for /refresh and cleans up the implementation of the /refresh Linux operator.
* Fix /software command Linux operationRoberto Hueso Gómez2020-01-212-4/+10
| | | | | This patch runs the script InventarioSoftware with the right arguments. This also increases the recv buffer size for the test server.
* Fix /shell/run commands splittingRoberto Hueso Gómez2020-01-212-2/+2
| | | | This patch splits shell commands either with ';' or '\n'.
* Fix /hardware command Linux operationRoberto Hueso Gómez2020-01-212-3/+6
| | | | This patch runs the script InventarioHardware with the right arguments.
* (Clean-Up) Rename all the functions in ogRest to new ones more clearsAlvaro Neira Ayuso2020-01-192-42/+32
|
* (Clean-Up) Rename HTTPParser file to restRequestAlvaro Neira Ayuso2020-01-192-1/+1
|
* (Clean-Up) Modify restResponse to get the response using constructor and get ↵Alvaro Neira Ayuso2020-01-191-40/+81
| | | | function
* (Clean-Up) Rename HTTPParser to restRequestAlvaro Neira Ayuso2020-01-194-79/+79
|
* (Clean-Up) Rename cmd variable to bodyAlvaro Neira Ayuso2020-01-191-15/+15
|
* (Clean-Up) Rename cmd function/variables to use "run" syntaxAlvaro Neira Ayuso2020-01-193-6/+6
|
* (Clean-Up) Rename jsoncmd variable to json_paramAlvaro Neira Ayuso2020-01-191-14/+14
|
* Improve /image/create command responseAlvaro Neira Ayuso2020-01-192-0/+14
| | | | | | | | | | | With this new patch, the image/create command will create a response message with more information for the server. The new format is: {"disk" : "1", "partition" : "1", "code" : "1", "id" : "1", "name" : "test", "repository" : "192.168.2.4", "software" : "xyz"} "xyz" will be the output saved during the execution of InventarioSoftware in a specific path.
* Add Refresh commandAlvaro Neira Ayuso2020-01-192-16/+57
| | | | | | | | | | | | This patch allows us to execute refresh command using ogClient. This command gets all the configuration in our machine and send this information to the server. The format of the message that ogClient will send to the server will be: {"disk": "1", "partition_setup": [{"partition": "1", "code": "LINUX", "filesystem": "NTFS", "size": "498688", "format": "0"}, {"partition": "2", "code": "LINUX", "filesystem": "NTFS", "size": "498688", "format": "0"}, {"partition": "3", "code": "LINUX", "filesystem": "NTFS", "size": "498688", "format": "0"}]}
* Add image/create command for creating a new imageAlvaro Neira Ayuso2020-01-192-0/+43
| | | | | | | | | | | | | | | | This patch allows us to use a new support for creating images using ogClient. ogClient receives from the server a message which json body must be: {"disk" : "1", "partition" : "1", "code" : "1", "id" : "1", "name" : "test", "repository" : "192.168.2.4" } ogClient returns to the server the software inventory executed before create the image. The message for the server is: { "disk" : "0", "partition" : "1", "software" : "xyz" } "xyz" will be the output saved during the execution of InventarioSoftware in a specific path.
* (BUG) Include client parameter in restore commandAlvaro Neira Ayuso2020-01-191-1/+1
|
* Include License headerAlvaro Neira Ayuso2020-01-197-0/+54
|
* Add stop commandAlvaro Neira Ayuso2020-01-192-35/+71
| | | | | This patch includes a new support for stopping all the process running on the ogClient.
* Execute cmd command using threadAlvaro Neira Ayuso2020-01-191-19/+18
| | | | This patch prepares the code for future stop command.
* Fix echo check for process_shellrun in ogRestRoberto Hueso Gómez2020-01-191-1/+1
|
* Change /probe from GET to POST in ogClientRoberto Hueso Gómez2020-01-191-3/+3
|
* Adapt client responses to the server'sRoberto Hueso Gómez2020-01-191-6/+9
| | | | Header parameters need to be sorted for the test server.
* Fix ogClient socket.error typoRoberto Hueso Gómez2020-01-191-1/+2
|
* Change ogClient.py encoding from dos to unixRoberto Hueso gomez2020-01-191-123/+123
|
* Include echo option for returning shell outputAlvaro Neira Ayuso2020-01-192-17/+15
| | | | | | | | | This patch adds a new echo option in /shell/run command. In case that the option is set up to true, the server will receive in the response a json with the shell output. Otherwise, the server will receive a response message without json body. A side effect of this change is that the command /shell/output/ disapears.
* Send OPG (opengnsys) status when a probe command is receivedAlvaro Neira Ayuso2020-01-191-1/+3
|
* Improve setup command responseAlvaro Neira Ayuso2020-01-192-5/+31
| | | | | | | | | | This patch adds a new response support. This way allows us to send a new response message with more information about the partitions already set up. The format of the response is: { "disk" : "1", "cache" : "1", "cache_size" : "0", "partition_setup": [{"partition": "1", "code": "LINUX", "filesystem": "EMPTY", "size": "498688", "format": "0"}...]
* Catch execution errors during restore image commandAlvaro Neira Ayuso2020-01-192-6/+14
| | | | | | This patch allows us to send feedback to the server in case of error during the execution of the command. In case of error, ogClient will send an "Internal Error" http message.
* Improve hardware command response behaviorAlvaro Neira Ayuso2020-01-192-6/+19
| | | | | | | | | | | This patch give us a better support in case of error or success execution. In error cases, the new behavior is to send an Internal Error http message (500). Otherwise, the server will receive a message with a json with this format: { "hardware" : "xyz" } "xyz" is the output saved in a specific path during the execution of InventarioHardware.
* Improve software command response behaviorAlvaro Neira Ayuso2020-01-192-7/+24
| | | | | | | | | | | | | | | During our tests, we found some limitation during the execution of the software command. We don't manage errors during the execution of this command. Moreover, the server needs some information in case that everything is OK. This patch modified the code for controlling the errors during the execution, returning an "Internal Error" http message (500). Moreover, in case that everything is OK, ogClient sends a message with this json body: { "disk" : "0", "partition" : "1", "software" : "xyz" } "xyz" will be the output saved during the execution of InventarioSoftware in a specific path.
* Catch execution errors during init session commandAlvaro Neira Ayuso2020-01-192-41/+53
| | | | | | This patch allows us to catch an exception when something wrong is happening executing the init session command. In error cases, ogClient sends an internal error http message to the server. Otherwise, an OK http message.
* Modify methods to use less argumentsAlvaro Neira Ayuso2020-01-192-34/+51
| | | | | | Now, all the arguments are received from httpparser. Those arguments convert the function in long lines of codes. Passing directly the httpparser, all the function will have less arguments and will be more clear the code.
* Add restore/image command for restoring images on the machineAlvaro Neira Ayuso2020-01-193-0/+53
| | | | | | | | | ogAdmClient has a support to restore image on the machine. This new command allows the new ogClient to execute the same script to restore the images on the machine. The json format sent from the server must be: { "disk" : "1", "partition" : "1", "name" : "test",\ "repository" : "192.168.56.10", "type" : "UNICAST", "profile": "1", "id": "1"}
* Add setup command for configuring the machineAlvaro Neira Ayuso2020-01-193-1/+38
| | | | | | | | | | ogAdmClient has a support to configure the machines. This new command allows the new ogClient to execute the same script to configure the machine. The json format sent from the server must be: { "disk" : "1", "cache" : "0", "cache_size" : "70000000",\ "partition_setup": [{"partition": "1", "code": "NTFS", "filesystem": "NTFS",\ "size": "11000000", "format": "0"}]}
* Add schedule commandAlvaro Neira Ayuso2020-01-191-0/+5
| | | | No action executed. This command only return a 200 OK message.
* Add hardware command to inventory the machine hardwareAlvaro Neira Ayuso2020-01-192-0/+16
| | | | | | ogAdmClient has a support to inventory the hardware in a machine. This new command allows the new ogClient to execute the same script to inventory the hw. No arguments needed for executing the command