Make statePath a variable (temporary)
This is a temporary fix until the state path is made configurable.
This commit is contained in:
parent
66b0321bf7
commit
49c0d7f802
|
@ -16,7 +16,8 @@ type state struct {
|
||||||
Nodes []common.Node
|
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 {
|
func (s *state) save() error {
|
||||||
if err := os.MkdirAll(path.Dir(statePath), 0700); err != nil {
|
if err := os.MkdirAll(path.Dir(statePath), 0700); err != nil {
|
||||||
|
|
|
@ -9,6 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_state_save_soad(t *testing.T) {
|
func Test_state_save_soad(t *testing.T) {
|
||||||
|
statePath = "/tmp/wesher.json"
|
||||||
key := "abcdefghijklmnopqrstuvwxyzABCDEF"
|
key := "abcdefghijklmnopqrstuvwxyzABCDEF"
|
||||||
node := common.Node{
|
node := common.Node{
|
||||||
Name: "node",
|
Name: "node",
|
||||||
|
|
Loading…
Reference in New Issue