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
}
conn := connConfig.ConnectionURL
conn := connConfig.ConnectionString
if len(conn) == 0 {
conn = connConfig.ConnectionURL
}

View File

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

View File

@ -95,7 +95,9 @@ func (b *backend) pathConnectionWrite(
}
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"`
}

View File

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