~jamesh5979/charm-glance-sync:master

Last commit made on 2019-01-14
Get this branch:
git clone -b master https://git.launchpad.net/~jamesh5979/charm-glance-sync
Only James Hilling can upload to this branch. If you are James Hilling please log in for upload directions.

Branch merges

Branch information

Name:
master
Repository:
lp:~jamesh5979/charm-glance-sync

Recent commits

52ec591... by James Hilling

[j.hilling] updated README.md with more content

The 'README.md' now has additional content added.

Also performed a small refactoring within the charm.

f2d9d67... by James Hilling

[j.hilling] fix: now using correct glance-sync slave scripts

Fetched and ported the correct glance-sync slave scripts from:

https://code.launchpad.net/~glance-sync-charmers/glance-sync-slave-layer/+git/glance-sync-slave-layer/+ref/community-image

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.

TODO: complete 'README.md'.
TODO: Unit/Functional tests.

e7efff9... by James Hilling

[j.hilling] fixed bug within ./src/reactive/glance_sync.py

Found a bug within the charm, when the charm gets deployed with 'master_mode'
initially set to 'true', i.e:

 juju deploy --config master_mode=true \
 ~/charms/glance-sync-layer/xenial/glance-sync glance-sync

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.

cdfc7d7... by James Hilling

[j.hilling] ./src/README.md partially completed

68a66ef... by James Hilling

[j.hilling] refactored, fixed nrpe and custom novarc handlers

bc89374... by James Hilling

[j.hilling] Makefile completed

Tested all Makefile `make` combinations.

fb793e0... by James Hilling

[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.

181f7a1... by James Hilling

[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.

0f38173... by James Hilling

[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.

ce22db0... by James Hilling

[j.hilling] Debugged reactive/glance_sync.py handlers

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.