Merge lp:~axwalk/juju-core/lp1237709-maasname 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: | 2668 |
Proposed branch: | lp:~axwalk/juju-core/lp1237709-maasname |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
109 lines (+41/-15) 2 files modified
provider/maas/environ.go (+7/-6) provider/maas/environ_whitebox_test.go (+34/-9) |
To merge this branch: | bzr merge lp:~axwalk/juju-core/lp1237709-maasname |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+216844@code.launchpad.net |
Commit message
provider/maas: support maas-name directives
We treat all MAAS placement directives as
maas-name, and pass it on as a constraint
to the acquire-node API.
Partially fixes lp:1237709
Description of the change
provider/maas: support maas-name directives
We treat all MAAS placement directives as
maas-name, and pass it on as a constraint
to the acquire-node API.
Partially fixes lp:1237709
To post a comment you must log in.
Reviewers: mp+216844_ code.launchpad. net,
Message:
Please take a look.
Description:
provider/maas: support maas-name directives
We treat all MAAS placement directives as
maas-name, and pass it on as a constraint
to the acquire-node API.
Partially fixes lp:1237709
https:/ /code.launchpad .net/~axwalk/ juju-core/ lp1237709- maasname/ +merge/ 216844
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/90470044/
Affected files (+43, -15 lines): maas/environ. go maas/environ_ whitebox_ test.go
A [revision details]
M provider/
M provider/
Index: [revision details] 20140423075122- i59ghmkjmgzjrfa t
=== 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/ maas/environ. go maas/environ. go' maas/environ. go 2014-04-22 09:23:39 +0000 maas/environ. go 2014-04-23 09:33:46 +0000
=== modified file 'provider/
--- provider/
+++ provider/
@@ -171,11 +171,7 @@
}
func (env *maasEnviron) PrecheckInstanc e(series string, cons
constraints.Value, placement string) error {
- // TODO(axw) 2014-04-22 #1237709
- // Handle maas-name placement directive.
- if placement != "" {
- return fmt.Errorf("unknown placement directive: %s", placement)
- }
+ // We treat all placement directives as maas-name.
return nil
}
@@ -279,10 +275,13 @@
}
// acquireNode allocates a node from the MAAS. MAASObject, *tools.Tools, error) { nodeName string, cons MAASObject, *tools.Tools, error) { nts(cons) acquireParams, includeNetworks, excludeNetworks) s.Add(" agent_name" , environ. ecfg(). maasAgentName( )) Add("name" , nodeName) JSONObject Start() ; a.Next(); { acquireNode( Constraints, MachineConfig. IncludeNetworks , MachineConfig. ExcludeNetworks ,
-func (environ *maasEnviron) acquireNode(cons constraints.Value,
includeNetworks, excludeNetworks []string, possibleTools tools.List)
(gomaasapi.
+func (environ *maasEnviron) acquireNode(
constraints.Value, includeNetworks, excludeNetworks []string, possibleTools
tools.List) (gomaasapi.
acquireParams := convertConstrai
addNetworks(
acquireParam
+ if nodeName != "" {
+ acquireParams.
+ }
var result gomaasapi.
var err error
for a := shortAttempt.
@@ -414,7 +413,9 @@
) {
var inst *maasInstance
var err error
+ nodeName := args.Placement
node, tools, err := environ.
+ nodeName,
args.
args.
args.
Index: provider/ maas/environ_ whitebox_ test.go maas/environ_ whitebox_ test.go' maas/environ_ whitebox_ test.go 2014-04-21 11:07:50 +0000 maas/environ_ whitebox_ test.go 2014-04-23 09:33:46 +0000
=== modified file 'provider/
--- provider/
+++ provider/
@@ -270,13 +270,38 @@
env := suite.makeEnviron()
suite.testMAASO bject.TestServe r.NewNode( `{"system_ id": "node0", "hostname": "host0"}`)
- _, _, err := env.acquireNode (constraints. Value{} , nil, nil, fakeTools} ) bject.TestServe r.NodeOperation s()
tools.List{
-
- c.Check(err, gc.IsNil)
- operations := suite.testMAASO
- actions, found := operations["node0"]
- c.Assert(found, gc.Equals, true)
- c.Check(actions, gc.DeepEqual...