Merge lp:~lifeless/pyjuju/apt-proxy-support into lp:~hazmat/pyjuju/apt-proxy-support

Proposed by Robert Collins
Status: Needs review
Proposed branch: lp:~lifeless/pyjuju/apt-proxy-support
Merge into: lp:~hazmat/pyjuju/apt-proxy-support
Diff against target: 42 lines (+5/-7)
2 files modified
juju/control/bootstrap.py (+2/-4)
juju/providers/common/base.py (+3/-3)
To merge this branch: bzr merge lp:~lifeless/pyjuju/apt-proxy-support
Reviewer Review Type Date Requested Status
Kapil Thangavelu Pending
Review via email: mp+111763@code.launchpad.net

Description of the change

This tweaks your branch to work for bootstrap.

The handing around of data seems a little confused here and there; I'd consider making cloud-init a top level idiom and just pass a dict around of everything-for-cloud-init; let providers w/out use it as the lingua franca. But thats a different story.

Anyhow, bunch of little tweaks, no tests, but - it bootstraps off of my proxy.

Running 'juju deploy haproxy' after that doesn't reuse the apt-proxy ::: but I'm running from source, so who knows whats up there.
curl http://169.254.169.254/1.0/user-data shows that the apt-proxy setting was not passed to cloud-init for the new node.

To post a comment you must log in.
Revision history for this message
Kapil Thangavelu (hazmat) wrote :

Hi Robert,

thanks for the branch, i ended up making the provider calls a bit more
flexible in the core upgrade branch to support multiple datums provided to
the launch calls. it was originally that way but got lost in a refactor.

cheers,

Kapil

On Sun, Jun 24, 2012 at 11:39 PM, Robert Collins
<email address hidden>wrote:

> Robert Collins has proposed merging lp:~lifeless/juju/apt-proxy-support
> into lp:~hazmat/juju/apt-proxy-support.
>
> Requested reviews:
> Kapil Thangavelu (hazmat)
>
> For more details, see:
> https://code.launchpad.net/~lifeless/juju/apt-proxy-support/+merge/111763
>
> This tweaks your branch to work for bootstrap.
>
> The handing around of data seems a little confused here and there; I'd
> consider making cloud-init a top level idiom and just pass a dict around of
> everything-for-cloud-init; let providers w/out use it as the lingua franca.
> But thats a different story.
>
> Anyhow, bunch of little tweaks, no tests, but - it bootstraps off of my
> proxy.
>
> Running 'juju deploy haproxy' after that doesn't reuse the apt-proxy :::
> but I'm running from source, so who knows whats up there.
> curl http://169.254.169.254/1.0/user-data shows that the apt-proxy
> setting was not passed to cloud-init for the new node.
> --
> https://code.launchpad.net/~lifeless/juju/apt-proxy-support/+merge/111763
> You are requested to review the proposed merge of
> lp:~lifeless/juju/apt-proxy-support into lp:~hazmat/juju/apt-proxy-support.
>
> === modified file 'juju/control/bootstrap.py'
> --- juju/control/bootstrap.py 2012-06-22 19:30:51 +0000
> +++ juju/control/bootstrap.py 2012-06-25 03:38:18 +0000
> @@ -18,8 +18,7 @@
> sub_parser.add_argument(
> "--apt-proxy",
> help="Apt proxy URL for use by all environment machines.",
> - default=None,
> - type=expand_constraints)
> + default=None)
> return sub_parser
>
>
> @@ -44,5 +43,4 @@
> options.log.info(
> "Bootstrapping environment %r (origin: %s type: %s)..." % (
> environment.name, environment.origin, environment.type))
> - yield provider.bootstrap(
> - constraints, {"apt-proxy": options.apt_proxy})
> + yield provider.bootstrap(constraints, options.apt_proxy)
>
> === modified file 'juju/providers/common/base.py'
> --- juju/providers/common/base.py 2012-06-22 19:30:51 +0000
> +++ juju/providers/common/base.py 2012-06-25 03:38:18 +0000
> @@ -1,4 +1,4 @@
> -]import copy
> +import copy
> from operator import itemgetter
>
> from twisted.internet.defer import inlineCallbacks, returnValue, succeed
> @@ -160,9 +160,9 @@
> """
> return ZookeeperConnect(self).run(share=share)
>
> - def bootstrap(self, constraints):
> + def bootstrap(self, constraints, apt_proxy_url=None):
> """Bootstrap an juju server in the provider."""
> - return Bootstrap(self, constraints).run()
> + return Bootstrap(self, constraints,
> apt_proxy_url=apt_proxy_url).run()
>
> def get_machine(self, instance_id):
> """Retrieve a provider machine by instance id.
>
>
>

Unmerged revisions

537. By Robert Collins

Use the value, not a manually constructed dict, for apt-proxy, as the launch class takes it as a separate parameter.

536. By Robert Collins

Support the new API call through provider.bootstrap. Gets to attempted bootstrap (fails with bad config on the instance).

535. By Robert Collins

Use the right type for the apt proxy.

534. By Robert Collins

Fix typo.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'juju/control/bootstrap.py'
2--- juju/control/bootstrap.py 2012-06-22 19:30:51 +0000
3+++ juju/control/bootstrap.py 2012-06-25 03:38:18 +0000
4@@ -18,8 +18,7 @@
5 sub_parser.add_argument(
6 "--apt-proxy",
7 help="Apt proxy URL for use by all environment machines.",
8- default=None,
9- type=expand_constraints)
10+ default=None)
11 return sub_parser
12
13
14@@ -44,5 +43,4 @@
15 options.log.info(
16 "Bootstrapping environment %r (origin: %s type: %s)..." % (
17 environment.name, environment.origin, environment.type))
18- yield provider.bootstrap(
19- constraints, {"apt-proxy": options.apt_proxy})
20+ yield provider.bootstrap(constraints, options.apt_proxy)
21
22=== modified file 'juju/providers/common/base.py'
23--- juju/providers/common/base.py 2012-06-22 19:30:51 +0000
24+++ juju/providers/common/base.py 2012-06-25 03:38:18 +0000
25@@ -1,4 +1,4 @@
26-]import copy
27+import copy
28 from operator import itemgetter
29
30 from twisted.internet.defer import inlineCallbacks, returnValue, succeed
31@@ -160,9 +160,9 @@
32 """
33 return ZookeeperConnect(self).run(share=share)
34
35- def bootstrap(self, constraints):
36+ def bootstrap(self, constraints, apt_proxy_url=None):
37 """Bootstrap an juju server in the provider."""
38- return Bootstrap(self, constraints).run()
39+ return Bootstrap(self, constraints, apt_proxy_url=apt_proxy_url).run()
40
41 def get_machine(self, instance_id):
42 """Retrieve a provider machine by instance id.

Subscribers

People subscribed via source and target branches