The constructor of the Repository object is being used for two distinct
purposes. One is to load the object from database and other to instantiate it
with parameter such that it can be saved to database. Separating the two usages
to different methods simplifies code and parameter passing for consumers.
Also turn some class specific constants from globals to class constants.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This introduces flake8 and fixes a bunch of flake8 errors.
flake8 is run with: ./venv/bin/flake8 plinth
if you're using a python3 venv.
We can eventually further integrate this with gitlab ci.
https://salsa.debian.org/freedombox-team/plinth/issues/58
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Ensure that loaded module list is mocked instead of actually loading modules.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Disk labels are unreliable. They may not exist. There are not unique and two
disks in the system may have the same label. Instead use the device path of the
disk/partition.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Each application will be able to implement backup_pre, backup_post, restore_pre
and restore_post hooks that get called before/after backup/restore
appropriately. This is to handle any edge cases that backup manifest mechanism
does not handle.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Introduce a BackupApp class to store all information about application being
backed up. This cleans up apps lists vs. manifest lists spread out in the
code.
- Introduce ServiceHandler to abstract dealing with services and web
configuration.
- Add enable and disable actions in apache action.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This serves two purposes. First is to assure user in the interface that backup
of the module is not required. Second is to make sure that if an application
is installed during backup it is also reinstalled during restore process (this
need to be implemented).
- Allow backup test to run independently. Initialize the cfg module so that
load_modules() works.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>