summaryrefslogtreecommitdiffstats
path: root/src/utils/cache.py
Commit message (Collapse)AuthorAgeFilesLines
* utils: cache: redefine cache path constantsAlejandro Sirgo Rica2024-05-271-8/+9
| | | | | | | | | Rename OGIMG as OG_IMAGE_PATH. Rename OGCACHE_MOUNTPOINT as OG_CACHE_PATH. Define OG_CACHE_IMAGE_PATH as OG_CACHE_PATH + OG_IMAGE_PATH. This will serve to have a unique point to obtain cache related paths.
* utils: rename cache_probe() to get_cache_dev_path()OpenGnSys Support Team2024-05-091-2/+2
| | | | | | | | This method reports the /dev path to cache partition, rename it. Add explicit check if blkid is successful. And add logging to report that device path to cache is not found.
* utils: make init_cache() use the cache mountpointAlejandro Sirgo Rica2024-03-261-1/+1
| | | | | | Make init_cache() use the actual cache mountpoint returned by the function mount_cache() for the creation of the cache directories instead of a hardcoded path.
* cache: improve loggingOpenGnSys Support Team2024-02-221-1/+1
| | | | | use info instead of debug to make it easier to debug problems when creating the cache.
* 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.