Merge lp://staging/~fwereade/juju-core/config-3-state-unit-settings-rename into lp://staging/~juju/juju-core/trunk
Proposed by
William Reade
Status: | Merged |
---|---|
Approved by: | William Reade |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1272 |
Proposed branch: | lp://staging/~fwereade/juju-core/config-3-state-unit-settings-rename |
Merge into: | lp://staging/~juju/juju-core/trunk |
Prerequisite: | lp://staging/~fwereade/juju-core/config-2-trivial-error-message-change |
Diff against target: | 0 lines |
To merge this branch: | bzr merge lp://staging/~fwereade/juju-core/config-3-state-unit-settings-rename |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+168577@code.staging.launchpad.net |
Description of the change
state: Unit.ConfigSettings
Better name, better type; suitable changes propagated amongst clients.
To post a comment you must log in.
Reviewers: mp+168577_ code.launchpad. net,
Message:
Please take a look.
Description:
state: Unit.ConfigSettings
Better name, better type; suitable changes propagated amongst clients.
https:/ /code.launchpad .net/~fwereade/ juju-core/ config- 3-state- unit-settings- rename/ +merge/ 168577
Requires: /code.launchpad .net/~fwereade/ juju-core/ config- 2-trivial- error-message- change/ +merge/ 168576
https:/
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/10169044/
Affected files: uniter/ context. go uniter/ context_ test.go uniter/ jujuc/config- get.go uniter/ jujuc/context. go uniter/ jujuc/util_ test.go
A [revision details]
M state/unit.go
M state/unit_test.go
M worker/
M worker/
M worker/
M worker/
M worker/
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: <email address hidden>
+New revision: <email address hidden>
Index: state/unit.go u.doc.Service)
=== modified file 'state/unit.go'
--- state/unit.go 2013-06-10 20:37:49 +0000
+++ state/unit.go 2013-06-10 21:04:37 +0000
@@ -98,8 +98,11 @@
return u.st.Service(
}
-// ServiceConfig returns the contents of this unit's service configuration. interface{ }, error) {
-func (u *Unit) ServiceConfig() (map[string]
+// ConfigSettings returns the complete set of service charm config settings
+// available to the unit. Unset values will be replaced with the default
+// value for the associated option, and may thus be nil when no default is
+// specified.
+func (u *Unit) ConfigSettings() (charm.Settings, error) {
if u.doc.CharmURL == nil {
return nil, fmt.Errorf("unit charm not set")
}
Index: state/unit_test.go unit_test. go' svc.Name( ), Equals, s.unit. ServiceName( ))
=== modified file 'state/
--- state/unit_test.go 2013-06-10 20:37:49 +0000
+++ state/unit_test.go 2013-06-10 21:04:37 +0000
@@ -45,30 +45,30 @@
c.Assert(
}
-func (s *UnitSuite) TestServiceConf igNeedsCharmURL Set(c *C) { ServiceConfig( ) ngsNeedCharmURL Set(c *C) { ConfigSettings( )
- _, err := s.unit.
+func (s *UnitSuite) TestConfigSetti
+ _, err := s.unit.
c.Assert(err, ErrorMatches, "unit charm not set")
}
-func (s *UnitSuite) TestServiceConf igIncludesDefau lts(c *C) { ngsIncludeDefau lts(c *C) { SetCharmURL( s.charm. URL()) ServiceConfig( ) ConfigSettings( ) interface{ }{"blog- title": "My "blog-title" : "My Title"})
+func (s *UnitSuite) TestConfigSetti
err := s.unit.
c.Assert(err, IsNil)
- settings, err := s.unit.
+ settings, err := s.unit.
c.Assert(err, IsNil)
- c.Assert(settings, DeepEquals, map[string]
Title"})
+ c.Assert(settings, DeepEquals, charm.Settings{
}
-func (s *UnitSuite) TestServiceConf igReflectsServi ce(c *C) { ngsReflectServi ce(c *C) { SetConfig( map[string] string{ "blog-title" : "no title"}) SetCharmURL( s.charm. URL()) ServiceConfig( ) ConfigSettings( )
+func (s *UnitSuite) TestConfigSetti
err := s.service.
c.Assert(err, IsNil)
err = s.unit.
c.Assert(err, IsNil)
- settings, err := s.unit.
+ settings, err := s.unit.
c.Assert(err, IsNil)
- c.Assert(settings, D...