Merge lp:~lmic/juju-deployer/juju-deployer-populate-first+add-machine-charm-series into lp:~jason-hobbs/juju-deployer/juju-deployer-populate-first

Proposed by Larry Michel
Status: Needs review
Proposed branch: lp:~lmic/juju-deployer/juju-deployer-populate-first+add-machine-charm-series
Merge into: lp:~jason-hobbs/juju-deployer/juju-deployer-populate-first
Diff against target: 61 lines (+12/-4)
1 file modified
deployer/action/importer.py (+12/-4)
To merge this branch: bzr merge lp:~lmic/juju-deployer/juju-deployer-populate-first+add-machine-charm-series
Reviewer Review Type Date Requested Status
Jason Hobbs Needs Fixing
Review via email: mp+262514@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jason Hobbs (jason-hobbs) wrote :

Did you test this?

Revision history for this message
Jason Hobbs (jason-hobbs) wrote :

The charm url can't be used to find the charm series - sometimes we deploy trusty charms onto precise and sometimes vice-versa.

review: Needs Fixing
Revision history for this message
Larry Michel (lmic) wrote :

Yes. It works. I had it running all weekend.

On Mon, Jun 22, 2015 at 9:23 AM, Jason Hobbs <email address hidden>
wrote:

> Did you test this?
> --
>
> https://code.launchpad.net/~lmic/juju-deployer/juju-deployer-populate-first+add-machine-charm-series/+merge/262514
> You are the owner of
> lp:~lmic/juju-deployer/juju-deployer-populate-first+add-machine-charm-series.
>

157. By Larry Michel <email address hidden>

only use charm series from url if it's win2012hvr2

Revision history for this message
Larry Michel (lmic) wrote :

> The charm url can't be used to find the charm series - sometimes we deploy
> trusty charms onto precise and sometimes vice-versa.

I added patch to this will only be done for win2012hvr2 series.

Unmerged revisions

157. By Larry Michel <email address hidden>

only use charm series from url if it's win2012hvr2

156. By Larry Michel <email address hidden>

acknowledge series from charm

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'deployer/action/importer.py'
2--- deployer/action/importer.py 2015-06-11 20:53:00 +0000
3+++ deployer/action/importer.py 2015-06-23 21:25:55 +0000
4@@ -183,6 +183,10 @@
5 charm = self.deployment.get_charm_for(svc.name)
6 self.log.info(
7 " Deploying service %s using %s", svc.name, charm.charm_url)
8+
9+ # The series will follow : in the url and precede /
10+ url_series = (charm.charm_url.split(':')[1]).split('/')[0]
11+ charm_series = url_series if url_series is 'win2012hvr2' else None
12
13 if svc.unit_placement:
14 # We sorted all the non placed services first, so we only
15@@ -221,7 +225,7 @@
16 self.log.debug('Pre-allocating machines for %s' % svc.name)
17 self.log.debug('Deploy base service: %s' % svc.name)
18 p = placement.get(0)
19- machine = self.get_machine(p)
20+ machine = self.get_machine(p, charm_series)
21 self.log.debug('deploy_services: '
22 'service=%s unit=0 placement=%s machine=%s' %
23 (svc.name, p, machine))
24@@ -243,7 +247,7 @@
25 placement = self.deployment.get_unit_placement(svc, env_status)
26 for uid in range(cur_units, svc.num_units):
27 p = placement.get(uid)
28- machine = self.get_machine(p)
29+ machine = self.get_machine(p, charm_series)
30 self.log.debug('add_units: '
31 'service=%s unit=%s placement=%s machine=%s' %
32 (svc.name, uid, p, machine))
33@@ -264,7 +268,7 @@
34 svc.config,
35 svc.constraints,
36 num_units,
37- self.get_machine(placement.get(0)))
38+ self.get_machine(placement.get(0), charm_series))
39
40 if svc.annotations:
41 self.log.debug(" Setting annotations")
42@@ -337,7 +341,7 @@
43 int(timeout), watch=self.options.watch,
44 services=self.deployment.get_service_names(), on_errors=on_errors)
45
46- def get_machine(self, u_idx):
47+ def get_machine(self, u_idx, charm_series=None):
48 # find the machine id that matches the target machine
49 # unlike juju status output, the dns-name is one of the
50 # many values returned from our env.status() in addresses
51@@ -365,6 +369,10 @@
52
53 # if we don't find a match, we need to add it
54 series = self.deployment.data['series']
55+ if (charm_series != None) and (charm_series != series):
56+ # override series if different from deployment series
57+ series = charm_series
58+
59 mid = self.env.add_specific_machine(u_idx, series)
60 self.deployment.log.debug(
61 'Waiting for machine to show up in status.')

Subscribers

People subscribed via source and target branches

to all changes: