Merge lp:~jimmiebtlr/juju-core/fix-no-peers-charms into lp:~go-bot/juju-core/trunk
Proposed by
Jimmie Butler
Status: | Needs review |
---|---|
Proposed branch: | lp:~jimmiebtlr/juju-core/fix-no-peers-charms |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
198 lines (+52/-17) 5 files modified
charm/meta.go (+2/-2) charm/meta_test.go (+15/-6) schema/schema.go (+20/-0) schema/schema_test.go (+9/-9) testing/repo/quantal/empty-fields/metadata.yaml (+6/-0) |
To merge this branch: | bzr merge lp:~jimmiebtlr/juju-core/fix-no-peers-charms |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+221156@code.launchpad.net |
Commit message
charm: accept missing relation maps
Description of the change
Allow charms without a peer listed.
To post a comment you must log in.
Unmerged revisions
- 2717. By Jimmie Butler
-
Change test to pass with omitempty for relations.
- 2716. By Jimmie Butler
-
Merge in most recent master
- 2715. By Jimmie Butler
-
Remove serialization change
- 2714. By Jimmie Butler
-
Merge in most recent master
- 2713. By Jimmie Butler
-
Go fmt.
- 2712. By Jimmie Butler
-
Change test order, put error check first.
- 2711. By Jimmie Butler
-
Change test order to check error first.
- 2710. By Jimmie Butler
-
Merge with most recent master.
- 2709. By Jimmie Butler
-
Merge in most recent master
- 2708. By Jimmie Butler
-
Remove unneeded statement in parseRelation.
Reviewers: mp+221156_ code.launchpad. net,
Message:
Please take a look.
Description:
Allow charms without a peer listed.
https:/ /code.launchpad .net/~jimmiebtl r/juju- core/fix- no-peers- charms/ +merge/ 221156
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/101810046/
Affected files (+61, -24 lines): schema_ test.go repo/quantal/ empty-fields/ metadata. yaml
A [revision details]
M charm/meta.go
M charm/meta_test.go
M schema/schema.go
M schema/
A testing/
Index: [revision details] 20140528050243- agcci9rl0vqrr91 1
=== 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: charm/meta.go
=== modified file 'charm/meta.go'
--- charm/meta.go 2014-04-09 16:36:12 +0000
+++ charm/meta.go 2014-05-21 01:59:05 +0000
@@ -96,13 +96,13 @@
Summary string
Description string
Subordinate bool
- Provides map[string]Relation `bson:",omitempty"`
- Requires map[string]Relation `bson:",omitempty"`
- Peers map[string]Relation `bson:",omitempty"`
- Format int `bson:",omitempty"`
- OldRevision int `bson:",omitempty"` // Obsolete
- Categories []string `bson:",omitempty"`
- Series string `bson:",omitempty"`
+ Provides map[string]Relation
+ Requires map[string]Relation
+ Peers map[string]Relation
+ Format int `bson:",omitempty"`
+ OldRevision int `bson:",omitempty"` // Obsolete
+ Categories []string `bson:",omitempty"`
+ Series string `bson:",omitempty"`
}
func generateRelatio nHooks( relName string, allHooks map[string]bool) {
@@ -262,10 +262,10 @@
}
func parseRelations( relations interface{}, role RelationRole) string] Relation) string] Relation) (map[string] interface{ }) { string] interface{ })
map[string]Relation {
+ result := make(map[
if relations == nil {
- return nil
+ return result
}
- result := make(map[
for name, rel := range relations.
relMap := rel.(map[
relation := Relation{
Index: charm/meta_test.go meta_test. go' meta.Requires, gc.IsNil) meta.Peers, gc.IsNil) meta.Requires, gc.DeepEquals, map[string] charm.Relation{ }) meta.Peers, gc.DeepEquals, map[string] charm.Relation{ })
=== modified file 'charm/
--- charm/meta_test.go 2014-04-09 16:36:12 +0000
+++ charm/meta_test.go 2014-05-28 05:01:55 +0000
@@ -93,8 +93,8 @@
Interface: "mysql",
Scope: charm.ScopeGlobal,
})
- c.Assert(
- c.Assert(
+ c.Assert(
+ c.Assert(
meta, err = charm.ReadMeta( repoMeta( "riak") ) meta.Requires, gc.IsNil) meta.Requires, gc.DeepEquals, map[string] charm.Relation{ })
c.Assert(err, gc.IsNil)
@@ -117,7 +117,7 @@
Limit: 1,
Scope: charm.ScopeGlobal,
})
- c.Assert(
+ c.Assert(
meta, err = charm.ReadMeta( repoMeta( "terracotta" )) meta.Requires, gc.IsNil) meta.Requires, gc.DeepEquals, map[string] charm.Relation{ })
c.Assert(err, gc.IsNil)
@@ -135,7 +135,7 @@
Limit: 1,
Scope: charm.ScopeGlobal,
})
- c.Assert(
+ c.Assert(
meta, err = charm.ReadMeta...