| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
Add agent mode for windows platform.
Subprocess module for shell/run is cross-platform an no change was
needed. The subprocess will run with the same privilege as its parent,
ogclient.
TODO: Provide a windows installer. As of now, an administrator
needs to install python and required libraries for this mode to be
usable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We can't use syslog if we want to execute ogClient in the Windows
platform.
Use the native logging library so we can attach different handlers
depending on the mode ogClient is executing.
Logging configuration is done via a python dict. There is a different
dict for linux and windows. These dicts define the configuration of the
root logger, handlers and formatters used.
As of now, it is only expected to use the root logger for everything
logging related. The root logger is obtained via:
LOGGER = logging.getLogger()
More info about handlers, formatters and loggers:
https://docs.python.org/3/howto/logging.html
Logging configuration is done at startup, just after parsing the json
(knowing ogclient mode). If json parsing goes bad, ogclient will only
print a message to stdout.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ogClient can run in "linux" mode. In addition to live or virtual.
Serves as a substitute to the legacy ogagent, which has not received any
updates since 2020/07/23.
Linux mode initially supports remote reboot and poweroff. Requires
updated ogServer with the Linux ogclient state.
ogClient can be set up to run in linux mode by specifying it in
ogclient.json:
{
"opengnsys": {
"ip": "192.168.56.10",
"port": 8889,
"log": "DEBUG",
"mode": "linux",
...
}
|
|
|
|
| |
Update license header in files.
|
|
|
|
|
|
|
|
| |
Separates probe method into separate ogclient modes (virtual, vdi) so
future supported OS can easily have a tailored probe responses.
Link speed is retrieved using a minimal ethtool command sent using fcntl
module from python.
|
|
|
|
|
|
|
|
|
|
|
| |
ogLive related operations are named inside a 'Linux' folder, also its
python class is named OgLinuxOperations. Rename every 'linux' occurrence
with live to further clarify this folder and operations.
- OgLinuxOperations -> OgLiveOperations
- src/linux/ -> src/live/
Fixes: 1377acee ('Rename 'linux' mode to 'live' mode')
|
|
|
|
|
|
|
| |
ogClient /software gets a representation of the target resource’s state.
GET method is more appropriate than POST.
Change /software method from POST to GET.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this patch the ogRest would hang indifinitely in a BUSY state
when a bad request was received. Fix this by returning ogRest state to
IDLE once the corresponding bad request response has been sent.
This accounts for the following cases:
- Unknown GET action
- Unknown POST action
- Unknown HTTP verb
|
|
|
|
|
|
|
| |
Image datasize is expressed in kibibytes but the existing REST API field
represent data in bytes.
This commit changes ogClient to send datasize in bytes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extend ogClient to include more information about the image that has been
created. This patch modifies ogClient to read an info file created by image
creation script, add this info to the JSON response and then remove the file.
Example of new /image/create response:
{
"disk": "1",
"partition": "1",
"code": "131",
"id": "1",
"name": "ubuntu",
"repository": "192.168.56.10",
"software": "Ubuntu 18.04.5 LTS \naccountsservice 0.6.45\n...",
"clonator": "PARTCLONE",
"compressor": "LZOP",
"filesystem": "EXTFS",
"datasize": 2100000
}
New fields are "clonator", "compressor", "filesystem" and "datasize".
|
|
|
|
|
|
|
|
|
| |
Disconnect gracefully from ogServer after booting OS, the script to start the
OS calls kexec, so everything is gone after it. For Windows, this results in a
reboot.
This commit also improves the disconnect function to make sure the
disconnection is synchronous.
|
|
|
|
|
| |
Since version 1.2.0, OpenGnsys supports ogVDI hypervisor OS. This commit
a new status which indicates that clients are running ogVDI
|
|
|
|
|
|
|
|
|
|
| |
This is useful for debuging and getting information on the processes that are
being executed in ogclient.
syslog outputs are something similar to:
Jun 26 10:36:40 ogAdministrator /ogclient: GET refresh HTTP/1.1
Jun 26 10:36:40 ogAdministrator /ogclient: HTTP/1.0 500 Internal Server Err
|
|
|
|
|
| |
This fixes a circular import error produced by the import of ogClient inside of
OgLinuxOperations.
|
|
|
|
| |
'linux' represents ogLive mode that is the reason for the rename.
|
|
|
|
|
|
| |
Improves code encapsulation by moving check_vm_state_loop method into
OgVirtualOperations class. This also fixes import error when running ogclient in
'linux' mode.
|
|
|
|
|
|
|
|
|
| |
ogClient may runs on an OS that do not have all the dependencies needed
to use virtual functions.
This commit change the behaviour to only import virtual functions when
the ogClient has to work with Virtual Machines. This way ogClient works
on environments which do not need virtual functions.
|
|
|
|
|
|
|
| |
ogClient changed its config file format to json. This patch adapts
ogLinuxOperation to use new config file.
Co-authored-by: Roberto Hueso <rhueso@soleta.eu>
|
|
|
|
|
| |
This patch waits before polling qemu with QMP so that it has time to be ready
for requests. It also increases wait time in case the host machine is slow.
|
|
|
|
| |
This patch also ignores calls to shellrun when virtual mode is activated.
|
|
|
|
|
| |
This patch makes configuration parsing easier as well as making the full
configuration available in many subclasses.
|
|
|
|
|
|
| |
This patch calls poweroff in virtual mode when no VM is running and no jobs are
being executed. This is useful when the guest OS shutdowns so that the host OS
does not continue to run.
|
| |
|
| |
|
|
|
|
| |
This requires to configure user and password for samba repositories.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
As defined by the HTTP standard.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
From pep-0008: Method Names and Instance Variables
Use the function naming rules: lowercase with words separated by underscores as
necessary to improve readability.
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
This patch also reformats the response to the /refresh command.
|
|
|
|
| |
ogAdmServer needs this space to work fine.
|
|
|
|
|
| |
This patch changes the HTTP method for /refresh and cleans up the implementation
of the /refresh Linux operator.
|
|
|
|
|
| |
This patch runs the script InventarioSoftware with the right arguments.
This also increases the recv buffer size for the test server.
|
|
|
|
| |
This patch splits shell commands either with ';' or '\n'.
|
|
|
|
| |
This patch runs the script InventarioHardware with the right arguments.
|
| |
|
| |
|
|
|
|
| |
function
|
| |
|
| |
|