Merge lp:~james-page/charm-helpers/amulet-switch-to-cs into lp:charm-helpers

Proposed by James Page
Status: Merged
Merged at revision: 582
Proposed branch: lp:~james-page/charm-helpers/amulet-switch-to-cs
Merge into: lp:charm-helpers
Diff against target: 73 lines (+22/-29)
1 file modified
charmhelpers/contrib/openstack/amulet/deployment.py (+22/-29)
To merge this branch: bzr merge lp:~james-page/charm-helpers/amulet-switch-to-cs
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+297060@code.launchpad.net

Description of the change

Update amulet helpers to deploy charms from the charm store

As part of the migration to git/gerrit and with the introduction of
layered charms, the charm store really needs to be the definative
source of truth for all charms during test.

Switch the charm resolver code to pick the correct charms from the
charm store for amulet tests.

This does change behaviour in that base charms are deployed aligned
to the test series where possible; otherwise the most recent Ubuntu
series is used instead - results in mysql/trusty + keystone/xenial
for example.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'charmhelpers/contrib/openstack/amulet/deployment.py'
--- charmhelpers/contrib/openstack/amulet/deployment.py 2016-03-22 17:26:45 +0000
+++ charmhelpers/contrib/openstack/amulet/deployment.py 2016-06-10 13:40:53 +0000
@@ -43,9 +43,6 @@
43 self.openstack = openstack43 self.openstack = openstack
44 self.source = source44 self.source = source
45 self.stable = stable45 self.stable = stable
46 # Note(coreycb): this needs to be changed when new next branches come
47 # out.
48 self.current_next = "trusty"
4946
50 def get_logger(self, name="deployment-logger", level=logging.DEBUG):47 def get_logger(self, name="deployment-logger", level=logging.DEBUG):
51 """Get a logger object that will log to stdout."""48 """Get a logger object that will log to stdout."""
@@ -72,38 +69,34 @@
7269
73 self.log.info('OpenStackAmuletDeployment: determine branch locations')70 self.log.info('OpenStackAmuletDeployment: determine branch locations')
7471
75 # Charms outside the lp:~openstack-charmers namespace72 # Charms outside the ~openstack-charmers
76 base_charms = ['mysql', 'mongodb', 'nrpe']73 base_charms = {
7774 'mysql': ['precise', 'trusty'],
78 # Force these charms to current series even when using an older series.75 'mongodb': ['precise', 'trusty'],
79 # ie. Use trusty/nrpe even when series is precise, as the P charm76 'nrpe': ['precise', 'trusty'],
80 # does not possess the necessary external master config and hooks.77 }
81 force_series_current = ['nrpe']
82
83 if self.series in ['precise', 'trusty']:
84 base_series = self.series
85 else:
86 base_series = self.current_next
8778
88 for svc in other_services:79 for svc in other_services:
89 if svc['name'] in force_series_current:
90 base_series = self.current_next
91 # If a location has been explicitly set, use it80 # If a location has been explicitly set, use it
92 if svc.get('location'):81 if svc.get('location'):
93 continue82 continue
94 if self.stable:83 if svc['name'] in base_charms:
95 temp = 'lp:charms/{}/{}'84 # NOTE: not all charms have support for all series we
96 svc['location'] = temp.format(base_series,85 # want/need to test against, so fix to most recent
97 svc['name'])86 # that each base charm supports
87 target_series = self.series
88 if self.series not in base_charms[svc['name']]:
89 target_series = base_charms[svc['name']][-1]
90 svc['location'] = 'cs:{}/{}'.format(target_series,
91 svc['name'])
92 elif self.stable:
93 svc['location'] = 'cs:{}/{}'.format(self.series,
94 svc['name'])
98 else:95 else:
99 if svc['name'] in base_charms:96 svc['location'] = 'cs:~openstack-charmers-next/{}/{}'.format(
100 temp = 'lp:charms/{}/{}'97 self.series,
101 svc['location'] = temp.format(base_series,98 svc['name']
102 svc['name'])99 )
103 else:
104 temp = 'lp:~openstack-charmers/charms/{}/{}/next'
105 svc['location'] = temp.format(self.current_next,
106 svc['name'])
107100
108 return other_services101 return other_services
109102

Subscribers

People subscribed via source and target branches