agent: Better warning for keyring with -encrypt option. Fixes #718.

This commit is contained in:
Ryan Uber 2015-02-19 18:51:32 -08:00
parent be8b14979e
commit 4193525931

View File

@ -162,12 +162,12 @@ func (c *Command) readConfig() *Config {
} }
keyfileLAN := filepath.Join(config.DataDir, serfLANKeyring) keyfileLAN := filepath.Join(config.DataDir, serfLANKeyring)
if _, err := os.Stat(keyfileLAN); err == nil { if _, err := os.Stat(keyfileLAN); err == nil {
c.Ui.Error("WARNING: LAN keyring exists but -encrypt given, ignoring") c.Ui.Error("WARNING: LAN keyring exists but -encrypt given, using keyring")
} }
if config.Server { if config.Server {
keyfileWAN := filepath.Join(config.DataDir, serfWANKeyring) keyfileWAN := filepath.Join(config.DataDir, serfWANKeyring)
if _, err := os.Stat(keyfileWAN); err == nil { if _, err := os.Stat(keyfileWAN); err == nil {
c.Ui.Error("WARNING: WAN keyring exists but -encrypt given, ignoring") c.Ui.Error("WARNING: WAN keyring exists but -encrypt given, using keyring")
} }
} }
} }