Removed all traces of unit and functional tests. Will begin
porting the relevant tests from 'glance-sync-slave-layer' and
'glance-sync-master-layer' repositories properly.
Refactored handlers file after changing the glance-sync slave
script within the charm.
Code within the 'configure_cron()' handler intended to run when 'master_mode'
is set to 'false', was accidentally being run when 'master_mode' was set to
'true', causing the charm to become stuck within a blocked state.
[j.hilling] fixed sync_enabled bug and removed data backup functionality
The 'data' directory backup function wasn't working well within the
handlers file. This is probably not the best place for it anyway. Hence,
I removed it altogether.
Fix: there was a bug when re-enabling sync via the 'sync_enabled' option,
where the charm didn't regenerate the cron file. This was due to a bug in
the handlers file.
Added a 'db_purge_deleted_glance_images.py' script from the
'glance-sync-slave-layer' charm repository into this charm, and created a
handler for it. The handler selects the correct script to use depending on
whether 'master_mode' is set to 'true' or not.
Started populating the Makefile for the charm. This had not been
updated yet, since I was building the charm manually from the 'charm'
snap.
Lot's of testing, charm seems to be working good from a deployment
perspective. Glance image sync still needs to be tested, but this
functionality is independent of my changes, and should just work, as
it did work in the previous slave and master charms.
TODO: 'README.md'
TODO: some refactoring
TODO: move the community-image enabled Glance-sync scripts into the
charm. This should just be a copy and paste job.
TODO: add a warning to 'config.yaml' file that when setting 'master_mode'
from the commandline, it will wipe the contents of the 'data' directory.
[j.hilling] added slave cleanup after 'master_mode' set to true
All artifacts left over from the unit being a slave are now
FULLY cleaned up when 'master_mode' is set to 'true'.
The only remenants from the unit being a slave is the
'/srv/glance_sync/data' directory, which I have the charm rename it
to 'data_old', which would be very useful in recovery situations.
TODO: append ISO date to 'data_old', after 'master_mode' is set to
'true'. I.e. it should instead read data_old-${DATE}. This will
stop the directory being overwritten.
TODO: implement toggle functionality for cases when you want to
go from a master back to a slave.
TODO: refactoring.
[j.hilling] Debugged reactive/glance_sync.py handlers - part II
Hook debugging with 'master_mode' set to true. The charm deploys
in master mode successfully when you pass the `juju deploy`
command a config file that contains the 'master_mode' option set
to true.
Added additional functionality to the handlers file, in order to
toggle a slave into a master, which provides no hook errors after
debugging the charm.
TODO: add additional cleanup after 'master_mode' has been
'toggled' to true.
TODO: refactoring.
Hook debugging with 'master_mode' set to false. The charm deploys
in slave mode successfully, with no hook errors after debugging
and upgrading the charm.
TODO: debug the charm when 'master_mode' is set to true.
TODO: refactoring.