Code review comment for lp:~axwalk/juju-core/lp1298159-manual-supportedarchitectures

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)
  }

« Back to merge proposal