From 02b0230f195bd3022d9ff4ac53f25c83c4142ed4 Mon Sep 17 00:00:00 2001 From: Brian Kassouf Date: Tue, 28 Mar 2017 10:04:42 -0700 Subject: [PATCH] Fix for checking types of database on update --- builtin/logical/database/path_config_connection.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builtin/logical/database/path_config_connection.go b/builtin/logical/database/path_config_connection.go index 1b0878670..ff633e745 100644 --- a/builtin/logical/database/path_config_connection.go +++ b/builtin/logical/database/path_config_connection.go @@ -279,6 +279,8 @@ func (b *databaseBackend) connectionWriteHandler(factory dbs.Factory) framework. } if _, ok := b.connections[name]; ok { + newType := db.Type() + // Don't update connection until the reset api is hit, close for // now. err = db.Close() @@ -287,7 +289,7 @@ func (b *databaseBackend) connectionWriteHandler(factory dbs.Factory) framework. } // Don't allow the connection type to change - if b.connections[name].Type() != connType { + if b.connections[name].Type() != newType { return logical.ErrorResponse("Can not change type of existing connection."), nil } } else {