Merge lp:~axwalk/juju-core/lp1298159-manual-supportedarchitectures into lp:~go-bot/juju-core/trunk

Proposed by Andrew Wilkins
Status: Merged
Approved by: Andrew Wilkins
Approved revision: no longer in the source branch.
Merged at revision: 2495
Proposed branch: lp:~axwalk/juju-core/lp1298159-manual-supportedarchitectures
Merge into: lp:~go-bot/juju-core/trunk
Diff against target: 52 lines (+5/-13)
2 files modified
provider/manual/environ.go (+2/-7)
provider/manual/environ_test.go (+3/-6)
To merge this branch: bzr merge lp:~axwalk/juju-core/lp1298159-manual-supportedarchitectures
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+212978@code.launchpad.net

Commit message

provider/manual: support all architectures

Change SupportedArchitectures to return all
architectures supported by Juju. Otherwise
we will not be able to provision machines
of architectures other than the bootstrap-host.

Fixes lp:1298159

https://codereview.appspot.com/81200043/

Description of the change

provider/manual: support all architectures

Change SupportedArchitectures to return all
architectures supported by Juju. Otherwise
we will not be able to provision machines
of architectures other than the bootstrap-host.

Fixes lp:1298159

https://codereview.appspot.com/81200043/

To post a comment you must log in.
Revision history for this message
Andrew Wilkins (axwalk) wrote :

Reviewers: mp+212978_code.launchpad.net,

Message:
Please take a look.

Description:
provider/manual: support all architectures

Change SupportedArchitectures to return all
architectures supported by Juju. Otherwise
we will not be able to provision machines
of architectures other than the bootstrap-host.

Fixes lp:1298159

https://code.launchpad.net/~axwalk/juju-core/lp1298159-manual-supportedarchitectures/+merge/212978

(do not edit description out of merge proposal)

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

Affected files (+7, -13 lines):
   A [revision details]
   M provider/manual/environ.go
   M provider/manual/environ_test.go

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-20140326230643-olixj5ukxzhgt4cv
+New revision: <email address hidden>

Index: provider/manual/environ.go
=== modified file 'provider/manual/environ.go'
--- provider/manual/environ.go 2014-03-26 02:56:25 +0000
+++ provider/manual/environ.go 2014-03-27 03:04:52 +0000
@@ -25,6 +25,7 @@
   "launchpad.net/juju-core/environs/storage"
   envtools "launchpad.net/juju-core/environs/tools"
   "launchpad.net/juju-core/instance"
+ "launchpad.net/juju-core/juju/arch"
   "launchpad.net/juju-core/provider/common"
   "launchpad.net/juju-core/state"
   "launchpad.net/juju-core/state/api"
@@ -89,13 +90,7 @@

  // SupportedArchitectures is specified on the EnvironCapability interface.
  func (e *manualEnviron) SupportedArchitectures() ([]string, error) {
- envConfig := e.envConfig()
- host := envConfig.bootstrapHost()
- hc, _, err := manual.DetectSeriesAndHardwareCharacteristics(host)
- if err != nil {
- return nil, err
- }
- return []string{*hc.Arch}, nil
+ return arch.AllSupportedArches, nil
  }

  func (e *manualEnviron) Bootstrap(ctx environs.BootstrapContext, cons
constraints.Value) error {

Index: provider/manual/environ_test.go
=== modified file 'provider/manual/environ_test.go'
--- provider/manual/environ_test.go 2014-03-25 13:18:46 +0000
+++ provider/manual/environ_test.go 2014-03-27 03:04:52 +0000
@@ -15,6 +15,7 @@
   "launchpad.net/juju-core/environs/storage"
   "launchpad.net/juju-core/environs/tools"
   "launchpad.net/juju-core/instance"
+ "launchpad.net/juju-core/juju/arch"
   "launchpad.net/juju-core/testing/testbase"
  )

@@ -140,11 +141,7 @@
  }

  func (s *environSuite) TestSupportedArchitectures(c *gc.C) {
- s.PatchValue(&manual.DetectSeriesAndHardwareCharacteristics, func(host
string) (instance.HardwareCharacteristics, string, error) {
- c.Assert(host, gc.Equals, "hostname")
- return instance.MustParseHardware("arch=arm64"), "precise", nil
- })
- a, err := s.env.SupportedArchitectures()
+ arches, err := s.env.SupportedArchitectures()
   c.Assert(err, gc.IsNil)
- c.Assert(a, gc.DeepEquals, []string{"arm64"})
+ c.Assert(arches, gc.DeepEquals, arch.AllSupportedArches)
  }

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'provider/manual/environ.go'
2--- provider/manual/environ.go 2014-03-26 02:56:25 +0000
3+++ provider/manual/environ.go 2014-03-27 03:07:40 +0000
4@@ -25,6 +25,7 @@
5 "launchpad.net/juju-core/environs/storage"
6 envtools "launchpad.net/juju-core/environs/tools"
7 "launchpad.net/juju-core/instance"
8+ "launchpad.net/juju-core/juju/arch"
9 "launchpad.net/juju-core/provider/common"
10 "launchpad.net/juju-core/state"
11 "launchpad.net/juju-core/state/api"
12@@ -89,13 +90,7 @@
13
14 // SupportedArchitectures is specified on the EnvironCapability interface.
15 func (e *manualEnviron) SupportedArchitectures() ([]string, error) {
16- envConfig := e.envConfig()
17- host := envConfig.bootstrapHost()
18- hc, _, err := manual.DetectSeriesAndHardwareCharacteristics(host)
19- if err != nil {
20- return nil, err
21- }
22- return []string{*hc.Arch}, nil
23+ return arch.AllSupportedArches, nil
24 }
25
26 func (e *manualEnviron) Bootstrap(ctx environs.BootstrapContext, cons constraints.Value) error {
27
28=== modified file 'provider/manual/environ_test.go'
29--- provider/manual/environ_test.go 2014-03-25 13:18:46 +0000
30+++ provider/manual/environ_test.go 2014-03-27 03:07:40 +0000
31@@ -15,6 +15,7 @@
32 "launchpad.net/juju-core/environs/storage"
33 "launchpad.net/juju-core/environs/tools"
34 "launchpad.net/juju-core/instance"
35+ "launchpad.net/juju-core/juju/arch"
36 "launchpad.net/juju-core/testing/testbase"
37 )
38
39@@ -140,11 +141,7 @@
40 }
41
42 func (s *environSuite) TestSupportedArchitectures(c *gc.C) {
43- s.PatchValue(&manual.DetectSeriesAndHardwareCharacteristics, func(host string) (instance.HardwareCharacteristics, string, error) {
44- c.Assert(host, gc.Equals, "hostname")
45- return instance.MustParseHardware("arch=arm64"), "precise", nil
46- })
47- a, err := s.env.SupportedArchitectures()
48+ arches, err := s.env.SupportedArchitectures()
49 c.Assert(err, gc.IsNil)
50- c.Assert(a, gc.DeepEquals, []string{"arm64"})
51+ c.Assert(arches, gc.DeepEquals, arch.AllSupportedArches)
52 }

Subscribers

People subscribed via source and target branches

to status/vote changes: