Merge lp://staging/~sinzui/juju-core/backport-underscores into lp://staging/juju-core/1.16

Proposed by Curtis Hovey
Status: Merged
Approved by: Curtis Hovey
Approved revision: no longer in the source branch.
Merged at revision: 1976
Proposed branch: lp://staging/~sinzui/juju-core/backport-underscores
Merge into: lp://staging/juju-core/1.16
Diff against target: 32 lines (+10/-1)
2 files modified
names/relation.go (+1/-1)
names/relation_test.go (+9/-0)
To merge this branch: bzr merge lp://staging/~sinzui/juju-core/backport-underscores
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+192937@code.staging.launchpad.net

Commit message

Backport underscores in relation name fix.

Description of the change

Backport underscores in relation name fix.

Relation names can have underscores.

https://codereview.appspot.com/18640043/

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Reviewers: mp+192937_code.launchpad.net,

Message:
Please take a look.

Description:
Backport underscores in relation name fix.

Relation names can have underscores.

https://code.launchpad.net/~sinzui/juju-core/backport-underscores/+merge/192937

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/18640043/

Affected files (+12, -1 lines):
   A [revision details]
   M names/relation.go
   M names/relation_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-20131017110030-3qkmwi95yqtlclze
+New revision: <email address hidden>

Index: names/relation.go
=== modified file 'names/relation.go'
--- names/relation.go 2013-09-11 10:23:23 +0000
+++ names/relation.go 2013-10-28 19:07:21 +0000
@@ -9,7 +9,7 @@
   "strings"
  )

-const RelationSnippet = "[a-z][a-z0-9]*(-[a-z0-9]+)*"
+const RelationSnippet = "[a-z][a-z0-9]*([_-][a-z0-9]+)*"

  // Relation keys have the format "service1:relName1 service2:relName2".
  // Except the peer relations, which have the format "service:relName"

Index: names/relation_test.go
=== modified file 'names/relation_test.go'
--- names/relation_test.go 2013-09-11 11:21:28 +0000
+++ names/relation_test.go 2013-10-28 19:07:21 +0000
@@ -33,6 +33,15 @@
   {pattern: "42also-not", valid: false},
   {pattern: "042", valid: false},
   {pattern: "0x42", valid: false},
+ {pattern: "foo_42", valid: true},
+ {pattern: "_foo", valid: false},
+ {pattern: "!foo", valid: false},
+ {pattern: "foo_bar-baz_boo", valid: true},
+ {pattern: "foo bar", valid: false},
+ {pattern: "foo-_", valid: false},
+ {pattern: "foo-", valid: false},
+ {pattern: "foo_-a", valid: false},
+ {pattern: "foo_", valid: false},
  }

  func (s *relationSuite) TestRelationKeyFormats(c *gc.C) {

Revision history for this message
Nate Finch (natefinch) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: