Setup data.db in global vagrant data path

This commit is contained in:
sophia 2021-08-17 10:04:28 -05:00 committed by Paul Hinze
parent 1f6407705d
commit 058d929046
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0

View File

@ -11,6 +11,7 @@ import (
"github.com/boltdb/bolt"
"github.com/golang/protobuf/ptypes/empty"
"github.com/hashicorp/go-plugin"
"github.com/hashicorp/vagrant-plugin-sdk/helper/paths"
"google.golang.org/grpc"
"github.com/hashicorp/vagrant/internal/protocolversion"
@ -91,8 +92,11 @@ func (c *Client) initLocalServer(ctx context.Context) (_ *grpc.ClientConn, err e
}
}()
// TODO(spox): path to this
path := filepath.Join("data.db")
dataPath, err := paths.VagrantData()
if err != nil {
return
}
path := dataPath.Join("data.db").String()
log.Debug("opening local mode DB", "path", path)
// Open our database