Merge lp:~thumper/juju-core/local-config-tilde into lp:~go-bot/juju-core/trunk
Proposed by
Tim Penhey
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Tim Penhey | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 1640 | ||||
Proposed branch: | lp:~thumper/juju-core/local-config-tilde | ||||
Merge into: | lp:~go-bot/juju-core/trunk | ||||
Diff against target: |
39 lines (+16/-1) 2 files modified
environs/local/config_test.go (+14/-0) environs/local/environprovider.go (+2/-1) |
||||
To merge this branch: | bzr merge lp:~thumper/juju-core/local-config-tilde | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+179454@code.launchpad.net |
Commit message
Fix the ~/ expansion in local provider config.
Description of the change
Fix the ~/ expansion in local provider config.
To post a comment you must log in.
Reviewers: mp+179454_ code.launchpad. net,
Message:
Please take a look.
Description:
Fix the ~/ expansion in local provider config.
https:/ /code.launchpad .net/~thumper/ juju-core/ local-config- tilde/+ merge/179454
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/12491046/
Affected files: local/config_ test.go local/environpr ovider. go
A [revision details]
M environs/
M environs/
Index: [revision details] 20130809101629- 8zemj78995x4068 u
=== 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: environs/ local/config_ test.go local/config_ test.go' local/config_ test.go 2013-07-17 02:34:39 +0000 local/config_ test.go 2013-08-09 14:30:22 +0000 unknownAttrs[ "root-dir" ], gc.Equals, root)
=== modified file 'environs/
--- environs/
+++ environs/
@@ -78,6 +78,20 @@
c.Assert(
}
+func (s *configSuite) TestValidateCon figWithTildeInR ootDir( c *gc.C) { lues() Validate( testConfig, nil) Join(os. Getenv( "HOME") , ".juju", "foo") trs() unknownAttrs[ "root-dir" ], gc.Equals, expectedRootDir) local.ConfigNam espace( testConfig) , gc.Equals, "tester-test")
+ values := minimalConfigVa
+ values["root-dir"] = "~/.juju/foo"
+ testConfig, err := config.New(values)
+ c.Assert(err, gc.IsNil)
+
+ valid, err := local.Provider.
+ c.Assert(err, gc.IsNil)
+
+ expectedRootDir := filepath.
+ unknownAttrs := valid.UnknownAt
+ c.Assert(
+}
+
func (s *configSuite) TestNamespace(c *gc.C) {
testConfig := minimalConfig(c)
c.Assert(
Index: environs/ local/environpr ovider. go local/environpr ovider. go' local/environpr ovider. go 2013-08-09 06:42:05 +0000 local/environpr ovider. go 2013-08-09 14:30:22 +0000 Path(localConfi g.rootDir( )) JujuHomePath( cfg.Name( )) attrs[" root-dir" ] = dir attrs[" root-dir" ] = dir
=== modified file 'environs/
--- environs/
+++ environs/
@@ -88,8 +88,9 @@
dir := utils.Normalize
if dir == "." {
dir = config.
- localConfig.
}
+ // Always assign the normalized path.
+ localConfig.
// Apply the coerced unknown values back into the config. localConfig. attrs)
return cfg.Apply(