Merge lp:~mthaddon/charms/trusty/glance-simplestreams-sync/run-parts-file-extensions into lp:charms/trusty/glance-simplestreams-sync

Proposed by Tom Haddon
Status: Merged
Merge reported by: James Page
Merged at revision: not available
Proposed branch: lp:~mthaddon/charms/trusty/glance-simplestreams-sync/run-parts-file-extensions
Merge into: lp:charms/trusty/glance-simplestreams-sync
Diff against target: 32 lines (+3/-3)
2 files modified
config.yaml (+2/-2)
hooks/hooks.py (+1/-1)
To merge this branch: bzr merge lp:~mthaddon/charms/trusty/glance-simplestreams-sync/run-parts-file-extensions
Reviewer Review Type Date Requested Status
Mike McCracken (community) Disapprove
charmers Pending
Review via email: mp+232237@code.launchpad.net

Description of the change

By default the "frequency" option is set to "daily". The charm then installs /usr/share/glance-simplestreams-sync/glance-simplestreams-sync.py and creates a symlink to it in /etc/cron.daily. "run-parts" silently ignores any scripts with a dot in the name [1], so this never gets run. Update the charm to remove that file extension.

Note that this will fix newly installed charms, but won't fix existing versions. Let me know if you'd like that changed, as it will mean carrying some "cruft" in the charm for a while to remove the .py version of the file.

[1] http://man.cx/run-parts%288%29 "the Debian cron script namespace (^[a−z0−9][a−z0−9−]*$)"

Also, fix the default arch filter for the mirror_list config variable to actually work.

To post a comment you must log in.
53. By Tom Haddon

Fix the default arch filter for the mirror_list config variable to actually work

Revision history for this message
Scott Moser (smoser) wrote :

looks good to me.

Revision history for this message
Mike McCracken (mikemc) wrote :

Unfortunately these were already fixed in lp:glance-simplestreams-sync, but not yet merged into the charms branch:

fix for cron job naming (and other bugs regarding changing config values on a running charm):
http://bazaar.launchpad.net/~cloud-installer/glance-simplestreams-sync-charm/trunk/revision/52

fix for typo in default arch filter: http://bazaar.launchpad.net/~cloud-installer/glance-simplestreams-sync-charm/trunk/revision/53

I will propose the updated charm ASAP. My apologies for the duplicate effort.

review: Disapprove
Revision history for this message
Mike McCracken (mikemc) wrote :

oops, lp:glance-simplestreams-sync should be lp:glance-simplestreams-sync-charm - that's the LP project.

Currently the active development of the code is on github here: https://github.com/Ubuntu-Solutions-Engineering/glance-simplestreams-sync-charm

The LP project is just an import of the 'master' branch of that repo.

Revision history for this message
Mike McCracken (mikemc) wrote :
Revision history for this message
James Page (james-page) wrote :

github code already merged so marking this as merged as well

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2014-06-18 18:43:42 +0000
3+++ config.yaml 2014-09-26 16:40:26 +0000
4@@ -4,7 +4,7 @@
5 default: "[{url: 'http://cloud-images.ubuntu.com/releases/',
6 name_prefix: 'ubuntu:released',
7 path: 'streams/v1/index.sjson', max: 1,
8- item_filters: ['release=trusty', 'arch=(x86_64|amd64)', 'ftype~(disk1.img|disk.img)']}]"
9+ item_filters: ['release=trusty', 'arch~(x86_64|amd64)', 'ftype~(disk1.img|disk.img)']}]"
10 description: >
11 YAML-formatted list of simplestreams mirrors and their configuration
12 properties. Defaults to downloading the released images from
13@@ -28,4 +28,4 @@
14 cloud_name:
15 type: string
16 default: "glance-simplestreams-sync-openstack"
17- description: "Cloud name to be used in simplestreams index file"
18\ No newline at end of file
19+ description: "Cloud name to be used in simplestreams index file"
20
21=== modified file 'hooks/hooks.py'
22--- hooks/hooks.py 2014-06-18 18:15:29 +0000
23+++ hooks/hooks.py 2014-09-26 16:40:26 +0000
24@@ -40,7 +40,7 @@
25 MIRRORS_CONF_FILE_NAME = os.path.join(CONF_FILE_DIR, 'mirrors.yaml')
26 ID_CONF_FILE_NAME = os.path.join(CONF_FILE_DIR, 'identity.yaml')
27
28-SCRIPT_NAME = "glance-simplestreams-sync.py"
29+SCRIPT_NAME = "glance-simplestreams-sync"
30
31 CRON_POLL_FILENAME = 'glance_simplestreams_sync_fastpoll'
32 CRON_POLL_FILEPATH = os.path.join('/etc/cron.d', CRON_POLL_FILENAME)

Subscribers

People subscribed via source and target branches