Commit Graph

128 Commits (1a83ebba238bb4c16a178e48c6f15e038b1f6209)
 

Author SHA1 Message Date
Roberto Hueso Gómez 1a83ebba23 Control errors in OgQMP for virtual mode
This patch handles possible communication errors between ogclient and Qemu when
making QMP requests.
2020-04-22 13:02:55 +02:00
Javier Sánchez Parra 0807ec76ed Add realtime log menu
We observed that with the new ogClient the ogLive did not show the
realtime log menu*.

This commit changes the ogClient to launch the browser and show the
realtime log menu when some commands are executed.

* The realtime log menu is a menu that shows current status and info
  about the command that the ogLive is executing.
2020-04-22 10:39:02 +02:00
Roberto Hueso Gómez b576836e43 Avoid killing ogclient in virtual mode 2020-04-20 09:14:52 +02:00
Roberto Hueso Gómez 2e3d47b7b8 Avoid writting /software output to a file 2020-04-17 16:59:48 +02:00
Roberto Hueso Gómez 7ccc498014 Use samba for create and restore virtual partitions
This requires to configure user and password for samba repositories.
2020-04-17 15:50:35 +02:00
Roberto Hueso Gómez dfb69e9dd5 Use libguestfs for virtual setup 2020-04-17 15:49:21 +02:00
Roberto Hueso Gómez 84e02462c0 Use libguestfs for virtual refresh 2020-04-17 15:49:21 +02:00
Roberto Hueso Gómez 8ec8572da2 Transform absolute paths into relative paths for virtual mode 2020-04-17 15:49:21 +02:00
Javier Sánchez Parra eec50f777c Increase HTML menu regeneration cases
We have observed that the ogLive browser did not show the changes when
an image restoration o script execution was called. The problem was that
the HTML menu was not updated/regenerated in these cases.

This commit adds the call to the HTML regeneration function to image
restore and script execution commands. This way, when the browser is
restarted it loads the updated HTML menu.
2020-04-16 13:53:13 +02:00
Javier Sánchez Parra f0c550ee2a Change browser behaviour
We have observed that the browser did not show changes. This happens
because the ogClient opens the browser at the beginning and forget
about it. To show correctly the changes ogClient had to restart the
browser every time the menu html changes.

This commit changes the behaviour to restart the browser when the menu
html has changed.
2020-04-16 13:29:06 +02:00
Roberto Hueso Gómez a32bf4071e Change default server port 2020-04-16 10:15:29 +02:00
OpenGnSys Support Team 439e5db7b7 wait for 1 second if connection is refused 2020-04-14 12:05:15 +02:00
Roberto Hueso Gomez 8a927a352d Sleep 1 second to avoid high CPU load 2020-04-14 11:48:13 +02:00
Roberto Hueso Gomez d6c5f2443a Avoid connection status infinite print loop
This patch avoids infinite writting of connection status messages to the log.
2020-04-14 11:31:22 +02:00
Roberto Hueso Gomez f56065a438 Fix reboot and poweroff threads args 2020-04-13 15:16:52 +02:00
Roberto Hueso Gomez 0ddf3f287a Add placeholder for virtual execCMD 2020-04-13 12:38:45 +02:00
Alvaro Neira Ayuso 1212040df1 Rename ogClient to ogclient in config path 2020-04-12 20:27:49 +02:00
Alvaro Neira Ayuso 058c2b5413 Launch browser only in linux configuration 2020-04-12 20:27:48 +02:00
Roberto Hueso Gomez 7f646fc468 Use 75% of disk space in virtual mode 2020-04-08 13:35:34 +02:00
Roberto Hueso Gomez 4f03c31f85 Add mode selection for ogClient 2020-04-08 13:31:45 +02:00
Roberto Hueso Gomez 99ae598fbd Encapsulate operations in classes 2020-04-08 13:30:16 +02:00
Roberto Hueso Gomez c279325919 Add virtual operations 2020-04-07 13:55:09 +02:00
OpenGnSys Support Team 99f2951395 add shebang to python3 and update permission 2020-03-31 20:15:32 +02:00
Javier Sanchez Parra f11e345dbf Rename config file
This commit changes the name of the config file from ogagent.cfg to
ogclient.cfg.
2020-03-24 08:06:02 +01:00
OpenGnSys Support Team 2cd7f5b4fc missing update to use ogConfig.OG_PATH in linux/ogOperations.py 2020-03-20 15:11:02 +01:00
Javier Sanchez Parra 4cd87e9875 Make OG_PATH public
This commit changes the OG_PATH to a public varible of the class
ogConfig. This way we improve the configurability of the path.
2020-03-20 14:53:07 +01:00
OpenGnSys Support Team d69841ed97 rename getURI to get_uri in restRequest 2020-03-09 18:10:57 +01:00
OpenGnSys Support Team 5964e48df9 rename execcmd to shellrun 2020-03-09 18:10:54 +01:00
OpenGnSys Support Team a6d3b7915c use lowercase attribute name in restRequest 2020-03-09 18:10:49 +01:00
Roberto Hueso Gómez 4e1ad0f949 Put state to IDLE after run/schedule 2020-03-03 14:13:10 +01:00
Roberto Hueso Gómez b53f8d0f8f Send complete HTTP header when response has no body 2020-03-02 09:32:40 +01:00
OpenGnSys Support Team a85c113ee7 Rename operation to method
As defined by the HTTP standard.
2020-02-26 17:58:15 +01:00
Javier Sanchez Parra 8e81b8091e Search the key in the parsed json
Testing the ogClient I found that if a value of the json match a key the
ogClient has an exception. For example:

	body = "... shell/run {"run": "fdisk -l"} ..."

	CURRENT
	Enters in
	if "disk" in body:...
	if "run" in body:...

	EXPECTED
	Enters in
	if "run" in body:...

This commit changes the behaviour to search for the keys in the
dictionary returned by json.loads() instead of searching in the raw
string. This way the ogClient looks for the keys without searching in
the values.
2020-02-26 17:55:03 +01:00
Roberto Hueso Gómez bb9ec5d7a5 Handle scripts that end in \r 2020-02-25 18:56:49 +01:00
Javier Sánchez Parra bf69d20966 Launch the graphical interface
This patch adds the launching of the browser that works as interface for
the users in ogLive.
2020-02-24 14:53:42 +01:00
Alvaro Neira Ayuso 6f7ba325b8 Modify way to close PID process
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.
2020-02-24 09:35:24 +01:00
Alvaro Neira Ayuso 583057bd69 Use state machine to avoid race condition problems
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.
2020-02-23 20:04:47 +01:00
OpenGnSys Support Team e5f1db1e47 remove unused getters 2020-02-21 12:58:11 +01:00
OpenGnSys Support Team 3917c3675f pep-0008 cleanup
From pep-0008: Method Names and Instance Variables

Use the function naming rules: lowercase with words separated by underscores as
necessary to improve readability.
2020-02-21 12:57:54 +01:00
Roberto Hueso Gómez 54c0ebf098 Use 'bash' as the default shell for operations scripts 2020-02-09 00:04:43 +01:00
Roberto Hueso Gómez 1fd9f2e07c Use 'with' keyword for file reading
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.
2020-02-05 16:49:42 +01:00
Roberto Hueso Gómez 1c236b4548 Use python f-strings for commands composition 2020-02-05 16:49:37 +01:00
Roberto Hueso Gómez eaba1acbc3 Fix /session execution
The script now reads arguments correctly.
2020-02-05 13:42:20 +01:00
Roberto Hueso Gómez fe4236dcd8 Fix /image/restore execution and response 2020-02-05 13:42:10 +01:00
Roberto Hueso Gómez 680214317e Fix /image/create execution and response 2020-02-05 13:41:54 +01:00
Alvaro Neira Ayuso 834f5cd5c2 Convert main file from dos format to unix format
Change from dos format to unix the whole main file.
2020-02-04 14:23:05 +01:00
Alvaro Neira Ayuso 38056d78a7 (BUG) Rename OG_SCRIPT_PATH to OG_PATH 2020-02-04 14:19:38 +01:00
Roberto Hueso Gómez 2934773d88 Fix /setup execution and response 2020-02-03 10:15:54 +01:00
Roberto Hueso Gómez e96e187825 Fix parseGetConf(...) configuration parsing
This patch also reformats the response to the /refresh command.
2020-02-03 10:15:49 +01:00
OpenGnSys Support Team f86999da0c add space after Content-Length and Content-Type
ogAdmServer needs this space to work fine.
2020-01-28 09:14:13 +01:00