summaryrefslogtreecommitdiffstats
path: root/src/utils/cache.py
Commit message (Collapse)AuthorAgeFilesLines
* utils: add init_cache functionJose M. Guisado2023-02-081-0/+12
| | | | | | | | | | | | | | | init_cache() creates the default directory in which OpenGnsys stores images when using any cache enabled transfer method. As of this commit this folder must exist for tiptorrent.py to work properly. Subprocess Popen object inside tiptorrent.py use 'cwd' optional parameter like: cwd='/opt/opengnsys/cache/opt/opengnsys/images/' This folder convention might change in the future.
* src: improve loggingJose M. Guisado2022-06-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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: generate cache.txt file in refreshJose M. Guisado2022-06-011-0/+69
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.