Skip to content

Commit

Permalink
cluster: fix wrong data_dir for imported drainer instances (#1346)
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroProfundis authored May 10, 2021
1 parent 073b8a9 commit a229992
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/cluster/ansible/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ func parseDirs(user string, ins spec.InstanceSpec, sshTimeout uint64, sshType ex
newIns.DeployDir = strings.TrimPrefix(line, "DEPLOY_DIR=")
continue
}
if strings.Contains(line, "--data-dir") {
dataArg := strings.Split(line, " ")[4] // 4 whitespaces ahead
dataDir := strings.TrimPrefix(dataArg, "--data-dir=")
newIns.DataDir = strings.Trim(dataDir, "\"")
continue
}
if strings.Contains(line, "--log-file=") {
fullLog := strings.Split(line, " ")[4] // 4 whitespaces ahead
logDir := strings.TrimSuffix(strings.TrimPrefix(fullLog,
Expand Down

0 comments on commit a229992

Please sign in to comment.