Merge lp:~mikemc/charms/trusty/glance-simplestreams-sync/add-source-config into lp:charms/trusty/glance-simplestreams-sync

Proposed by Mike McCracken
Status: Merged
Merged at revision: 61
Proposed branch: lp:~mikemc/charms/trusty/glance-simplestreams-sync/add-source-config
Merge into: lp:charms/trusty/glance-simplestreams-sync
Prerequisite: lp:~freyes/charms/trusty/glance-simplestreams-sync/lp1522929
Diff against target: 37 lines (+19/-0)
2 files modified
config.yaml (+18/-0)
hooks/hooks.py (+1/-0)
To merge this branch: bzr merge lp:~mikemc/charms/trusty/glance-simplestreams-sync/add-source-config
Reviewer Review Type Date Requested Status
Marco Ceppi (community) Approve
Review via email: mp+282806@code.launchpad.net

This proposal supersedes a proposal from 2016-01-15.

Commit message

Add 'source' and 'key' config options to support adding a PPA source for packages installed by the charm.

Description of the change

Add 'source' and 'key' config options to support adding a PPA source for packages installed by the charm.

This is potentially generally useful but is motivated by wanting the cloud-installer/simplestreams-testing PPA on trusty. That PPA had been unconditionally installed, but that was causing issues and will be removed by this branch: https://code.launchpad.net/~freyes/charms/trusty/glance-simplestreams-sync/lp1522929/+merge/279644

This option allows us to add that PPA only when required.

To post a comment you must log in.
Revision history for this message
Marco Ceppi (marcoceppi) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'config.yaml'
--- config.yaml 2015-09-08 16:25:57 +0000
+++ config.yaml 2016-01-15 20:02:49 +0000
@@ -78,3 +78,21 @@
78 description: |78 description: |
79 A comma-separated list of nagios servicegroups.79 A comma-separated list of nagios servicegroups.
80 If left empty, the nagios_context will be used as the servicegroup80 If left empty, the nagios_context will be used as the servicegroup
81 source:
82 type: string
83 default:
84 description: |
85 Optional configuration to support use of additional sources such as:
86
87 - ppa:myteam/ppa
88 - cloud:trusty-proposed/kilo
89 - http://my.archive.com/ubuntu main
90
91 The last option should be used in conjunction with the key configuration
92 option.
93 key:
94 type: string
95 default:
96 description: |
97 Key ID to import to the apt keyring to support use with arbitary source
98 configuration from outside of Launchpad archives or PPA's.
8199
=== modified file 'hooks/hooks.py'
--- hooks/hooks.py 2016-01-15 20:02:49 +0000
+++ hooks/hooks.py 2016-01-15 20:02:49 +0000
@@ -195,6 +195,7 @@
195@hooks.hook('install')195@hooks.hook('install')
196def install():196def install():
197 execd_preinstall()197 execd_preinstall()
198 add_source(hookenv.config('source'), hookenv.config('key'))
198 for directory in [CONF_FILE_DIR, USR_SHARE_DIR]:199 for directory in [CONF_FILE_DIR, USR_SHARE_DIR]:
199 hookenv.log("creating config dir at {}".format(directory))200 hookenv.log("creating config dir at {}".format(directory))
200 if not os.path.isdir(directory):201 if not os.path.isdir(directory):

Subscribers

People subscribed via source and target branches