summaryrefslogtreecommitdiffstats
path: root/src/live/ogOperations.py
Commit message (Collapse)AuthorAgeFilesLines
* src: improve loggingJose M. Guisado2022-06-081-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | Adds new logging handler redirecting messages to the log file located in the Samba shared directory (applies to live mode clients, i.e: ogLive) Parses log level configuration from ogclient.json. See: { "opengnsys": { ... "log": "INFO", ... } ... } Adds --debug option to set root logger level to DEBUG when starting ogClient. Overrides log level from config file. In addition: - Replaces any occurence of print with a corresponding logging function. - Unsets log level for handlers, use root logger level instead. - Default level for root logger is INFO. - Replaces level from response log messages to debug (ogRest)
* live: replace getConfiguration with refreshJose M. Guisado2022-06-011-10/+4
| | | | | | | Old refresh was a wrapper around getConfiguration bash script. New refresh operation does what getConfiguration used to do externally. See commit 097769b971f64f93004a87393721a289fe3db13f.
* live: assume VFAT is always FAT32Javier Sánchez Parra2022-06-011-0/+3
| | | | | fdisk reports VFAT, however, OpenGnsys does not have such entry in the filesystem table. Add an alias to FAT32 as a workaround.
* live: generate cache.txt file in refreshJose M. Guisado2022-06-011-0/+2
| | | | | | | | | | | | | Generates a cache.txt file if a cache partition is detected. OpenGnsys stores information about stored images in its 'cache' partition via a text file. The file is stored in a samba shared directory, mounted at '/opt/opengnsys/log/' in a live client. The file name is '{ip}.cache.txt'. Previously, the generation of this file was delegated to external bash scripts.
* Add link speed to refresh responseJavier Sánchez Parra2022-05-091-1/+4
| | | | | Probe response already has client's link speed, but this API is deprecated.
* live: detect cache partitions in new refreshJose M. Guisado2022-04-281-3/+14
| | | | | | | Detects OpenGnsys cache partition when building the partition setup of a live system. OpenGnsys labels a Linux/ext4 partition as "CACHE".
* live: get partition number using partno attributeJose M. Guisado2022-04-271-6/+7
| | | | | | | | | | | | Removes a workaround enumaration of the partitions of a given libfdisk context. Use Partition class partno attribute. This enables detecting non contiguous partitions, like: /dev/sda /dev/sda1 /dev/sda2 /dev/sda4
* live: use utils.py and fdisk in refresh operationJose M. Guisado2022-04-211-12/+71
| | | | | | | | | | | | Use python binding for libfdisk to retrieve disk label and partition information [1]. Use utils.py for the rest of the process. This change aims to drop dependency with external script 'getConfiguration' from the OpenGnsys scripting ecosystem. Keeps the same json payload structure for the refresh response. [1] https://git.48k.eu/python-libfdisk/
* live: use utils.py for probe operationJose M. Guisado2022-04-211-22/+4
| | | | Import ethtool function from utils.py
* #1037 Add disk typeJavier Sánchez Parra2021-05-261-0/+1
| | | | | | | Add ogClient support to receive, parse and send disk type data from the cloning engine when refreshing disks configuration. See also commits with #1037 in ogServer and WebConsole repo.
* ogClient is AGPLv3+OpenGnSys Support Team2021-05-141-3/+3
| | | | Update license header in files.
* #995 Add link speed in probe responsesJose M. Guisado2021-05-041-0/+29
| | | | | | | | 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.
* #1000 live: check imageCreate for non-zero return codev1.2.0Jose M. Guisado2020-12-151-0/+3
| | | | | | | | | When running image_create operation an underlying script "imageCreate" is called using the subprocess python module. This script may fail, for example if the repository in which the image is to be stored has no sufficent capacity. Check for non-zero when the imageCreate process has finished.
* Rename 'linux' folder and operations to 'live'Jose M. Guisado2020-12-031-0/+275
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')