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
=== 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:07:40 +0000
@@ -25,6 +25,7 @@
25 "launchpad.net/juju-core/environs/storage"25 "launchpad.net/juju-core/environs/storage"
26 envtools "launchpad.net/juju-core/environs/tools"26 envtools "launchpad.net/juju-core/environs/tools"
27 "launchpad.net/juju-core/instance"27 "launchpad.net/juju-core/instance"
28 "launchpad.net/juju-core/juju/arch"
28 "launchpad.net/juju-core/provider/common"29 "launchpad.net/juju-core/provider/common"
29 "launchpad.net/juju-core/state"30 "launchpad.net/juju-core/state"
30 "launchpad.net/juju-core/state/api"31 "launchpad.net/juju-core/state/api"
@@ -89,13 +90,7 @@
8990
90// SupportedArchitectures is specified on the EnvironCapability interface.91// SupportedArchitectures is specified on the EnvironCapability interface.
91func (e *manualEnviron) SupportedArchitectures() ([]string, error) {92func (e *manualEnviron) SupportedArchitectures() ([]string, error) {
92 envConfig := e.envConfig()93 return arch.AllSupportedArches, nil
93 host := envConfig.bootstrapHost()
94 hc, _, err := manual.DetectSeriesAndHardwareCharacteristics(host)
95 if err != nil {
96 return nil, err
97 }
98 return []string{*hc.Arch}, nil
99}94}
10095
101func (e *manualEnviron) Bootstrap(ctx environs.BootstrapContext, cons constraints.Value) error {96func (e *manualEnviron) Bootstrap(ctx environs.BootstrapContext, cons constraints.Value) error {
10297
=== 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:07:40 +0000
@@ -15,6 +15,7 @@
15 "launchpad.net/juju-core/environs/storage"15 "launchpad.net/juju-core/environs/storage"
16 "launchpad.net/juju-core/environs/tools"16 "launchpad.net/juju-core/environs/tools"
17 "launchpad.net/juju-core/instance"17 "launchpad.net/juju-core/instance"
18 "launchpad.net/juju-core/juju/arch"
18 "launchpad.net/juju-core/testing/testbase"19 "launchpad.net/juju-core/testing/testbase"
19)20)
2021
@@ -140,11 +141,7 @@
140}141}
141142
142func (s *environSuite) TestSupportedArchitectures(c *gc.C) {143func (s *environSuite) TestSupportedArchitectures(c *gc.C) {
143 s.PatchValue(&manual.DetectSeriesAndHardwareCharacteristics, func(host string) (instance.HardwareCharacteristics, string, error) {144 arches, err := s.env.SupportedArchitectures()
144 c.Assert(host, gc.Equals, "hostname")
145 return instance.MustParseHardware("arch=arm64"), "precise", nil
146 })
147 a, err := s.env.SupportedArchitectures()
148 c.Assert(err, gc.IsNil)145 c.Assert(err, gc.IsNil)
149 c.Assert(a, gc.DeepEquals, []string{"arm64"})146 c.Assert(arches, gc.DeepEquals, arch.AllSupportedArches)
150}147}

Subscribers

People subscribed via source and target branches

to status/vote changes: