forked from coop-cloud/abra
fix: log correctly on provisioning
This commit is contained in:
parent
066b2b9373
commit
b3496ad286
@ -247,19 +247,21 @@ func initSwarmLocal(c *cli.Context, cl *dockerClient.Client, domainName string)
|
||||
if !strings.Contains(err.Error(), "is already part of a swarm") {
|
||||
return err
|
||||
}
|
||||
logrus.Info("swarm mode already initialised on local server")
|
||||
} else {
|
||||
logrus.Infof("initialised swarm mode on local server")
|
||||
}
|
||||
|
||||
logrus.Infof("initialised swarm mode on local server")
|
||||
|
||||
netOpts := types.NetworkCreate{Driver: "overlay", Scope: "swarm"}
|
||||
if _, err := cl.NetworkCreate(c.Context, "proxy", netOpts); err != nil {
|
||||
if !strings.Contains(err.Error(), "is already part of a swarm") {
|
||||
if !strings.Contains(err.Error(), "proxy already exists") {
|
||||
return err
|
||||
}
|
||||
logrus.Info("swarm overlay network already created on local server")
|
||||
} else {
|
||||
logrus.Infof("swarm overlay network created on local server")
|
||||
}
|
||||
|
||||
logrus.Infof("swarm overlay network created on local server")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -299,19 +301,21 @@ func initSwarm(c *cli.Context, cl *dockerClient.Client, domainName string) error
|
||||
if !strings.Contains(err.Error(), "is already part of a swarm") {
|
||||
return err
|
||||
}
|
||||
logrus.Info("swarm mode already initialised on %s", domainName)
|
||||
} else {
|
||||
logrus.Infof("initialised swarm mode on %s", domainName)
|
||||
}
|
||||
|
||||
logrus.Infof("initialised swarm mode on %s", domainName)
|
||||
|
||||
netOpts := types.NetworkCreate{Driver: "overlay", Scope: "swarm"}
|
||||
if _, err := cl.NetworkCreate(c.Context, "proxy", netOpts); err != nil {
|
||||
if !strings.Contains(err.Error(), "is already part of a swarm") {
|
||||
if !strings.Contains(err.Error(), "proxy already exists") {
|
||||
return err
|
||||
}
|
||||
logrus.Infof("swarm overlay network already created on %s", domainName)
|
||||
} else {
|
||||
logrus.Infof("swarm overlay network created on %s", domainName)
|
||||
}
|
||||
|
||||
logrus.Infof("swarm overlay network created on %s", domainName)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user