Don't deprecate value field yet

This commit is contained in:
vishalnayak 2016-02-19 14:59:15 -05:00
parent 99f4969b20
commit 38b55bd8b1
4 changed files with 12 additions and 5 deletions

View File

@ -74,7 +74,7 @@ func (b *backend) DB(s logical.Storage) (*sql.DB, error) {
return nil, err return nil, err
} }
conn := connConfig.ConnectionURL conn := connConfig.ConnectionString
if len(conn) == 0 { if len(conn) == 0 {
conn = connConfig.ConnectionURL conn = connConfig.ConnectionURL
} }

View File

@ -14,14 +14,20 @@ import (
func TestBackend_basic(t *testing.T) { func TestBackend_basic(t *testing.T) {
b, _ := Factory(logical.TestBackendConfig()) b, _ := Factory(logical.TestBackendConfig())
d := map[string]interface{}{ d1 := map[string]interface{}{
"connection_url": os.Getenv("MYSQL_DSN"), "connection_url": os.Getenv("MYSQL_DSN"),
} }
d2 := map[string]interface{}{
"value": os.Getenv("MYSQL_DSN"),
}
logicaltest.Test(t, logicaltest.TestCase{ logicaltest.Test(t, logicaltest.TestCase{
PreCheck: func() { testAccPreCheck(t) }, PreCheck: func() { testAccPreCheck(t) },
Backend: b, Backend: b,
Steps: []logicaltest.TestStep{ Steps: []logicaltest.TestStep{
testAccStepConfig(t, d, false), testAccStepConfig(t, d1, false),
testAccStepRole(t),
testAccStepReadCreds(t, "web"),
testAccStepConfig(t, d2, false),
testAccStepRole(t), testAccStepRole(t),
testAccStepReadCreds(t, "web"), testAccStepReadCreds(t, "web"),
}, },

View File

@ -95,7 +95,9 @@ func (b *backend) pathConnectionWrite(
} }
type connectionConfig struct { type connectionConfig struct {
ConnectionURL string `json:"connection_url"` ConnectionURL string `json:"connection_url"`
// Deprecate "value" in coming releases
ConnectionString string `json:"value"`
MaxOpenConnections int `json:"max_open_connections"` MaxOpenConnections int `json:"max_open_connections"`
} }

View File

@ -138,7 +138,6 @@ allowed to read.
<li> <li>
<span class="param">value</span> <span class="param">value</span>
<span class="param-flags">optionsl</span> <span class="param-flags">optionsl</span>
DEPRECATED; use "connection_url" instead
</li> </li>
</ul> </ul>
</dd> </dd>