Updater
- class olaf.UpdaterState(value)[source]
The integer value Updater’s update() will return
- UPDATE_SUCCESSFUL = 0
The last update was successfully installed. Default State.
- PRE_UPDATE_FAILED = 1
The last update failed during the inital non critical section. Either the was an error using the file cache, when opening tarfile, or reading the instructions file.
- UPDATE_FAILED = 2
The update failed during the critical section. The updater fail while following the instructions.
- UPDATING = 255
Updater is updating
- class olaf.Updater(work_dir: str, cache_dir: str)[source]
The OreSat Linux updater. Allows OreSat Linux boards to be update thru update archives.
While this could be replaced with a couple of functions. Having a object with properties, allow for easy to get status info while updating.
- Parameters:
- add_update_archive(file_path: str) bool[source]
Copies update archive into the update archive cache.
- update()[source]
Run a update.
If there are file aleady in the working directory, it will try to find and resume the update, otherwise it will get the oldest archive from the update archive cache and run it.
If the update fails, the cache will be cleared, as it is asume all newer updates require the failed updated to be run successfully first.
- Raises:
UpdaterError – A error occurred when updating.
- make_status_archive() str[source]
Make status tar file with a copy of the dpkg status file, a file with the out put of
pip freeze(the list of python packages), and a file with the list ofupdates in cache.- Returns:
Path to new status file or empty string on failure.
- Return type:
- property status: UpdaterState
The current state.
- Type: