Make statePath a variable (temporary)
This is a temporary fix until the state path is made configurable.
This commit is contained in:
@ -16,7 +16,8 @@ type state struct {
|
||||
Nodes []common.Node
|
||||
}
|
||||
|
||||
const statePath = "/var/lib/wesher/state.json"
|
||||
// TODO: this should be replaced by a configurable path later
|
||||
var statePath = "/var/lib/wesher/state.json"
|
||||
|
||||
func (s *state) save() error {
|
||||
if err := os.MkdirAll(path.Dir(statePath), 0700); err != nil {
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func Test_state_save_soad(t *testing.T) {
|
||||
statePath = "/tmp/wesher.json"
|
||||
key := "abcdefghijklmnopqrstuvwxyzABCDEF"
|
||||
node := common.Node{
|
||||
Name: "node",
|
||||
|
Reference in New Issue
Block a user