From 8494b06ce0edb678094f0f946f0f6b645d213bb4 Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Thu, 15 Dec 2016 12:30:18 -0500 Subject: [PATCH] Don't error if the given data-dir doesn't exist --- command/agent/command.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/command/agent/command.go b/command/agent/command.go index dcb9ceb044..f81291453d 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -213,8 +213,10 @@ func (c *Command) readConfig() *Config { } if finfo, err := os.Stat(config.DataDir); err != nil { - c.Ui.Error(fmt.Sprintf("Error getting data-dir: %s", err)) - return nil + if !os.IsNotExist(err) { + c.Ui.Error(fmt.Sprintf("Error getting data-dir: %s", err)) + return nil + } } else if !finfo.IsDir() { c.Ui.Error(fmt.Sprintf("The data-dir specified at %q is not a directory", config.DataDir)) return nil