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
Reviewers: mp+212978_ code.launchpad. net,
Message:
Please take a look.
Description:
provider/manual: support all architectures
Change SupportedArchit ectures 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- supportedarchit ectures/ +merge/ 212978
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/81200043/
Affected files (+7, -13 lines): manual/ environ. go manual/ environ_ test.go
A [revision details]
M provider/
M provider/
Index: [revision details] 20140326230643- olixj5ukxzhgt4c v
=== 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-
+New revision: <email address hidden>
Index: provider/ manual/ environ. go manual/ environ. go' manual/ environ. go 2014-03-26 02:56:25 +0000 manual/ environ. go 2014-03-27 03:04:52 +0000 net/juju- core/environs/ storage" net/juju- core/environs/ tools" net/juju- core/instance" net/juju- core/juju/ arch" net/juju- core/provider/ common" net/juju- core/state" net/juju- core/state/ api"
=== modified file 'provider/
--- provider/
+++ provider/
@@ -25,6 +25,7 @@
"launchpad.
envtools "launchpad.
"launchpad.
+ "launchpad.
"launchpad.
"launchpad.
"launchpad.
@@ -89,13 +90,7 @@
// SupportedArchit ectures is specified on the EnvironCapability interface. ectures( ) ([]string, error) { bootstrapHost( ) DetectSeriesAnd HardwareCharact eristics( host) edArches, nil
func (e *manualEnviron) SupportedArchit
- envConfig := e.envConfig()
- host := envConfig.
- hc, _, err := manual.
- if err != nil {
- return nil, err
- }
- return []string{*hc.Arch}, nil
+ return arch.AllSupport
}
func (e *manualEnviron) Bootstrap(ctx environs. BootstrapContex t, cons
constraints.Value) error {
Index: provider/ manual/ environ_ test.go manual/ environ_ test.go' manual/ environ_ test.go 2014-03-25 13:18:46 +0000 manual/ environ_ test.go 2014-03-27 03:04:52 +0000 net/juju- core/environs/ storage" net/juju- core/environs/ tools" net/juju- core/instance" net/juju- core/juju/ arch" net/juju- core/testing/ testbase"
=== modified file 'provider/
--- provider/
+++ provider/
@@ -15,6 +15,7 @@
"launchpad.
"launchpad.
"launchpad.
+ "launchpad.
"launchpad.
)
@@ -140,11 +141,7 @@
}
func (s *environSuite) TestSupportedAr chitectures( c *gc.C) { &manual. DetectSeriesAnd HardwareCharact eristics, func(host HardwareCharact eristics, string, error) { MustParseHardwa re("arch= arm64") , "precise", nil Architectures( ) Architectures( ) edArches)
- s.PatchValue(
string) (instance.
- c.Assert(host, gc.Equals, "hostname")
- return instance.
- })
- a, err := s.env.Supported
+ arches, err := s.env.Supported
c.Assert(err, gc.IsNil)
- c.Assert(a, gc.DeepEquals, []string{"arm64"})
+ c.Assert(arches, gc.DeepEquals, arch.AllSupport
}