Merge lp:~axwalk/juju-core/lp1222664-maas-instance-stringer 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: | 1777 | ||||
Proposed branch: | lp:~axwalk/juju-core/lp1222664-maas-instance-stringer | ||||
Merge into: | lp:~go-bot/juju-core/trunk | ||||
Diff against target: |
67 lines (+32/-0) 2 files modified
provider/maas/instance.go (+11/-0) provider/maas/instance_test.go (+21/-0) |
||||
To merge this branch: | bzr merge lp:~axwalk/juju-core/lp1222664-maas-instance-stringer | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Julian Edwards (community) | Approve | ||
Juju Engineering | Pending | ||
Review via email: mp+184505@code.launchpad.net |
Commit message
provider/maas: add String method to maasInstance
Description of the change
provider/maas: add String method to maasInstance
To post a comment you must log in.
Reviewers: mp+184505_ code.launchpad. net,
Message:
Please take a look.
Description:
provider/maas: add String method to maasInstance
https:/ /code.launchpad .net/~axwalk/ juju-core/ lp1222664- maas-instance- stringer/ +merge/ 184505
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/13620043/
Affected files (+15, -0 lines): maas/instance. go maas/instance_ test.go
A [revision details]
M provider/
M provider/
Index: [revision details] 20130908094110- qc1z761lrq29tdu a
=== 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/instance. go maas/instance. go' maas/instance. go 2013-09-04 15:11:51 +0000 maas/instance. go 2013-09-09 06:35:14 +0000
=== modified file 'provider/
--- provider/
+++ provider/
@@ -17,6 +17,10 @@
var _ instance.Instance = (*maasInstance) (nil)
+func (mi *maasInstance) String() string { Id(mi.maasObjec t.URI() .String( ))
+ return string(mi.Id())
+}
+
func (mi *maasInstance) Id() instance.Id {
// Use the node's 'resource_uri' value.
return instance.
Index: provider/ maas/instance_ test.go maas/instance_ test.go' maas/instance_ test.go 2013-09-04 15:11:51 +0000 maas/instance_ test.go 2013-09-09 06:35:14 +0000
=== modified file 'provider/
--- provider/
+++ provider/
@@ -4,6 +4,8 @@
package maas
import ( net/gocheck"
+ "fmt"
+
gc "launchpad.
"launchpad. net/juju- core/instance" string( instance. Id()), gc.Equals, resourceURI)
@@ -25,6 +27,13 @@
c.Check(
}
+func (s *instanceTest) TestString(c *gc.C) { t.TestServer. NewNode( jsonValue) fmt.Sprint( instance) , gc.Equals, string( instance. Id())) ance(c *gc.C) { t.TestServer. NewNode( jsonValue)
+ jsonValue := `{"system_id": "system_id", "test": "test"}`
+ obj := s.testMAASObjec
+ instance := &maasInstance{&obj, s.environ}
+ c.Assert(
+}
+
func (s *instanceTest) TestRefreshInst
jsonValue := `{"system_id": "system_id", "test": "test"}`
obj := s.testMAASObjec