Merge lp:~thumper/juju-core/update-golxc-version into lp:~go-bot/juju-core/trunk

Proposed by Tim Penhey
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 2411
Proposed branch: lp:~thumper/juju-core/update-golxc-version
Merge into: lp:~go-bot/juju-core/trunk
Prerequisite: lp:~thumper/juju-core/container-dir-filesystem-type
Diff against target: 76 lines (+10/-6)
3 files modified
container/lxc/lxc.go (+6/-3)
container/lxc/mock/mock-lxc.go (+2/-2)
dependencies.tsv (+2/-1)
To merge this branch: bzr merge lp:~thumper/juju-core/update-golxc-version
Reviewer Review Type Date Requested Status
John A Meinel Approve
Ian Booth Approve
Review via email: mp+210492@code.launchpad.net

Commit message

Update golxc version

Since the new golxc version also depends on the
github juju/testing repo, this has also been added
to the dependency file.

https://codereview.appspot.com/74200043/

Description of the change

Update golxc version

Since the new golxc version also depends on the
github juju/testing repo, this has also been added
to the dependency file.

https://codereview.appspot.com/74200043/

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

Reviewers: mp+210492_code.launchpad.net,

Message:
Please take a look.

Description:
Update golxc version

Since the new golxc version also depends on the
github juju/testing repo, this has also been added
to the dependency file.

https://code.launchpad.net/~thumper/juju-core/update-golxc-version/+merge/210492

Requires:
https://code.launchpad.net/~thumper/juju-core/container-dir-filesystem-type/+merge/210101

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/74200043/

Affected files (+622, -349 lines):
   A [revision details]
   M cloudinit/cloudinit_test.go
   M cloudinit/options.go
   M cmd/juju/bootstrap.go
   A cmd/juju/common.go
   M cmd/juju/synctools.go
   M cmd/juju/upgradejuju.go
   M cmd/plugins/juju-metadata/validatetoolsmetadata.go
   M constraints/constraints.go
   M container/factory/factory_test.go
   M container/kvm/kvm.go
   M container/kvm/kvm_test.go
   M container/lxc/lxc.go
   M container/lxc/lxc_test.go
   M container/lxc/mock/mock-lxc.go
   M dependencies.tsv
   M environs/cloudinit/cloudinit.go
   M environs/cloudinit/cloudinit_test.go
   M environs/config/config.go
   M environs/config/config_test.go
   M environs/imagemetadata/simplestreams.go
   M environs/manual/init.go
   M environs/tools/testing/testing.go
   M environs/tools/tools.go
   M environs/tools/tools_test.go
   M instance/instance.go
   M juju/osenv/proxy.go
   M juju/osenv/proxy_test.go
   M provider/ec2/ec2.go
   M provider/ec2/local_test.go
   M provider/local/environprovider.go
   M provider/local/environprovider_test.go
   M provider/openstack/provider.go
   M scripts/release-public-tools/release-public-tools.sh
   M state/api/client.go
   M state/api/params/internal.go
   M state/apiserver/client/client.go
   M state/apiserver/client/client_test.go
   M worker/machineenvironmentworker/machineenvironmentworker_test.go
   M worker/uniter/context_test.go
   M worker/uniter/uniter_test.go
   M worker/upgrader/upgrader.go

Revision history for this message
Ian Booth (wallyworld) wrote :

+func (mock *mockContainer) Clone(name string, extraArgs []string, templateArgs []string) (golxc.Container, error) {

Why not

+func (mock *mockContainer) Clone(name string, extraArgs, templateArgs []string) (golxc.Container, error) {

Same with Create()

review: Approve
Revision history for this message
Tim Penhey (thumper) wrote :

Because it has to match the golxc implementation of the method.

With golxc, the args are passed through to the os.exec module, and would otherwise have to split the string somehow.

Revision history for this message
John A Meinel (jameinel) wrote :

I think you're missing the fact that in go:

 func Foo(a, b string)

is the same thing as

 func Foo(a string, b string)
I'm pretty sure Ian was just suggesting you didn't need to repeat the []string portion.

Anyway, if this is what it takes to bump the golxc version for any changes you've done, LGTM.

review: Approve
Revision history for this message
Go Bot (go-bot) wrote :

The attempt to merge lp:~thumper/juju-core/update-golxc-version into lp:juju-core failed. Below is the output from the failed tests.

# launchpad.net/juju-core/container/lxc
container/lxc/lxc.go:147: cannot use nil as type string in function argument
container/lxc/lxc.go:147: cannot use templateParams (type []string) as type string in function argument
# launchpad.net/juju-core/container/lxc/mock
container/lxc/mock/mock-lxc.go:82: cannot use mock (type *mockContainer) as type golxc.Container in assignment:
 *mockContainer does not implement golxc.Container (wrong type for Clone method)
  have Clone(string, []string, []string) (golxc.Container, error)
  want Clone(string) (golxc.Container, error)
container/lxc/mock/mock-lxc.go:124: cannot use container (type *mockContainer) as type golxc.Container in assignment:
 *mockContainer does not implement golxc.Container (wrong type for Clone method)
  have Clone(string, []string, []string) (golxc.Container, error)
  want Clone(string) (golxc.Container, error)
container/lxc/mock/mock-lxc.go:125: cannot use container (type *mockContainer) as type golxc.Container in return argument:
 *mockContainer does not implement golxc.Container (wrong type for Clone method)
  have Clone(string, []string, []string) (golxc.Container, error)
  want Clone(string) (golxc.Container, error)
container/lxc/mock/mock-lxc.go:214: cannot use mockContainer literal (type *mockContainer) as type golxc.Container in assignment:
 *mockContainer does not implement golxc.Container (wrong type for Clone method)
  have Clone(string, []string, []string) (golxc.Container, error)
  want Clone(string) (golxc.Container, error)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'container/lxc/lxc.go'
2--- container/lxc/lxc.go 2014-03-12 04:41:26 +0000
3+++ container/lxc/lxc.go 2014-03-12 04:41:26 +0000
4@@ -144,7 +144,7 @@
5 }
6 // Create the container.
7 logger.Tracef("create the container")
8- if err := lxcContainer.Create(configFile, defaultTemplate, templateParams...); err != nil {
9+ if err := lxcContainer.Create(configFile, defaultTemplate, nil, templateParams); err != nil {
10 logger.Errorf("lxc container creation failed: %v", err)
11 return nil, nil, err
12 }
13@@ -288,19 +288,22 @@
14 }
15
16 func generateNetworkConfig(network *container.NetworkConfig) string {
17+ var lxcConfig string
18 if network == nil {
19 logger.Warningf("network unspecified, using default networking config")
20 network = DefaultNetworkConfig()
21 }
22 switch network.NetworkType {
23 case container.PhysicalNetwork:
24- return networkConfigTemplate("phys", network.Device)
25+ lxcConfig = networkConfigTemplate("phys", network.Device)
26 default:
27 logger.Warningf("Unknown network config type %q: using bridge", network.NetworkType)
28 fallthrough
29 case container.BridgeNetwork:
30- return networkConfigTemplate("veth", network.Device)
31+ lxcConfig = networkConfigTemplate("veth", network.Device)
32 }
33+
34+ return lxcConfig
35 }
36
37 func writeLxcConfig(network *container.NetworkConfig, directory string) (string, error) {
38
39=== modified file 'container/lxc/mock/mock-lxc.go'
40--- container/lxc/mock/mock-lxc.go 2014-03-11 03:19:04 +0000
41+++ container/lxc/mock/mock-lxc.go 2014-03-12 04:41:26 +0000
42@@ -74,7 +74,7 @@
43 }
44
45 // Create creates a new container based on the given template.
46-func (mock *mockContainer) Create(configFile, template string, templateArgs ...string) error {
47+func (mock *mockContainer) Create(configFile, template string, extraArgs []string, templateArgs []string) error {
48 if mock.state != golxc.StateUnknown {
49 return fmt.Errorf("container is already created")
50 }
51@@ -114,7 +114,7 @@
52 }
53
54 // Clone creates a copy of the container, giving the copy the specified name.
55-func (mock *mockContainer) Clone(name string) (golxc.Container, error) {
56+func (mock *mockContainer) Clone(name string, extraArgs []string, templateArgs []string) (golxc.Container, error) {
57 container := &mockContainer{
58 factory: mock.factory,
59 name: name,
60
61=== modified file 'dependencies.tsv'
62--- dependencies.tsv 2014-03-10 00:10:29 +0000
63+++ dependencies.tsv 2014-03-12 04:41:26 +0000
64@@ -3,10 +3,11 @@
65 labix.org/v2/mgo bzr gustavo@niemeyer.net-20131118213720-aralgr4ienh0gdyq 248
66 github.com/errgo/errgo git 93d72bf813883d1054cae1c001d3a46603f7f559
67 github.com/juju/loggo git fa3acf9ab9ed09aea29030558528e24a254d27af
68+github.com/juju/testing git 26401ff267fff5b5bd18057235087748e5fd5bab
69 launchpad.net/gnuflag bzr roger.peppe@canonical.com-20121003093437-zcyyw0lpvj2nifpk 12
70 launchpad.net/goamz bzr roger.peppe@canonical.com-20131218155244-hbnkvlkkzy3vmlh9 44
71 launchpad.net/gocheck bzr gustavo@niemeyer.net-20130302024745-6ikofwq2c03h7giu 85
72-launchpad.net/golxc bzr ian.booth@canonical.com-20140116225718-lvoikrb0me6zugin 6
73+launchpad.net/golxc bzr tim.penhey@canonical.com-20140311005930-b14361bwnocu3krh 8
74 launchpad.net/gomaasapi bzr ian.booth@canonical.com-20131017011445-m1hmr0ap14osd7li 47
75 launchpad.net/goose bzr tarmac-20140124165235-h9rloooc531udms5 116
76 launchpad.net/goyaml bzr gustavo@niemeyer.net-20131114120802-abe042syx64z2m7s 50

Subscribers

People subscribed via source and target branches

to status/vote changes: