Merge lp:~wallyworld/juju-core/manual-provider-storage-port-type into lp:~go-bot/juju-core/trunk
Proposed by
Ian Booth
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Ian Booth | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 2588 | ||||
Proposed branch: | lp:~wallyworld/juju-core/manual-provider-storage-port-type | ||||
Merge into: | lp:~go-bot/juju-core/trunk | ||||
Diff against target: |
69 lines (+18/-5) 2 files modified
provider/manual/config.go (+2/-2) provider/manual/config_test.go (+16/-3) |
||||
To merge this branch: | bzr merge lp:~wallyworld/juju-core/manual-provider-storage-port-type | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+214866@code.launchpad.net |
Commit message
Force manual storage-port to int
The manual provider storage-port config
attribute needs to have a schema definition
of ForceInt so it can be deserialised from
state correctly.
Description of the change
Force manual storage-port to int
The manual provider storage-port config
attribute needs to have a schema definition
of ForceInt so it can be deserialised from
state correctly.
To post a comment you must log in.
Reviewers: mp+214866_ code.launchpad. net,
Message:
Please take a look.
Description:
Force manual storage-port to int
The manual provider storage-port config
attribute needs to have a schema definition
of ForceInt so it can be deserialised from
state correctly.
https:/ /code.launchpad .net/~wallyworl d/juju- core/manual- provider- storage- port-type/ +merge/ 214866
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/85750045/
Affected files (+20, -5 lines): manual/ config. go manual/ config_ test.go
A [revision details]
M provider/
M provider/
Index: [revision details] 20140408170048- h58307lijtftb3s 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: provider/ manual/ config. go manual/ config. go' manual/ config. go 2014-02-10 11:35:13 +0000 manual/ config. go 2014-04-09 01:12:03 +0000 host": schema.String(), user": schema.String(), listen- ip": schema.String(), auth-key" : schema.String(), sshstorage" : schema.Bool(),
=== modified file 'provider/
--- provider/
+++ provider/
@@ -17,7 +17,7 @@
"bootstrap-
"bootstrap-
"storage-
- "storage-port": schema.Int(),
+ "storage-port": schema.ForceInt(),
"storage-
"use-
}
@@ -59,7 +59,7 @@
}
func (c *environConfig) storagePort() int { "storage- port"]. (int64) ) "storage- port"]. (int)
- return int(c.attrs[
+ return c.attrs[
}
func (c *environConfig) storageAuthKey() string {
Index: provider/ manual/ config_ test.go manual/ config_ test.go' manual/ config_ test.go 2014-03-13 07:54:56 +0000 manual/ config_ test.go 2014-04-09 01:12:03 +0000 unknownAttrs[ "bootstrap- host"], gc.Equals, "hostname") unknownAttrs[ "bootstrap- user"], gc.Equals, "") unknownAttrs[ "storage- listen- ip"], gc.Equals, "") unknownAttrs[ "storage- port"], gc.Equals, int64(8040)) unknownAttrs[ "storage- port"], gc.Equals, int(8040))
=== modified file 'provider/
--- provider/
+++ provider/
@@ -72,7 +72,7 @@
c.Assert(
c.Assert(
c.Assert(
- c.Assert(
+ c.Assert(
}
func (s *configSuite) TestConfigMutab ility(c *gc.C) { host": "new-hostname", user": "new-username", listen- ip": "10.0.0.123", Apply(map[ string] interface{ }{k: v}) testConfig. storageAddr( ), gc.Equals, "hostname:8040") testConfig. storageListenAd dr(), gc.Equals, ":8040") "storage- listen- ip"] = "10.0.0.123" "storage- port"] = int64(1234) "storage- port"] = 1234 testConfig. storageAddr( ), gc.Equals, "hostname:1234") testConfig. storageListenAd dr(), gc.Equals, "10.0.0.123:1234") envConfig. useSSHStorage( ), jc.IsFalse) figWithFloatPor t(c *gc.C) {
@@ -89,7 +89,7 @@
"bootstrap-
"bootstrap-
"storage-
- "storage-port": int64(1234),
+ "storage-port": 1234,
} {
testConfig = MinimalConfig(c)
testConfig, err = testConfig.
@@ -119,7 +119,7 @@
c.Assert(
c.Assert(
values[
- values[
+ values[
testConfig = getEnvironConfig(c, values)
c.Assert(
c.Assert(
@@ -137,3 +137,16 @@
c.Assert(err, gc.IsNil)
c.Assert(
}
+
+func (s *configSuite) TestValidateCon
+ // When the config values get seria...