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