Skip to content

Commit

Permalink
Merge pull request #837 from Azure/pr0824c
Browse files Browse the repository at this point in the history
add the enable api, and core filer deletion as a multi-api call
  • Loading branch information
anhowe authored Aug 25, 2020
2 parents a0b0f89 + 53c8730 commit 2f3fd3e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/terraform/providers/terraform-provider-avere/averevfxt.go
Original file line number Diff line number Diff line change
Expand Up @@ -1208,8 +1208,17 @@ func (a *AvereVfxt) AvereCommandWithCorrection(cmd string, correctiveAction func
// the corrective action is best effort, just log an error if one occurs
if err = correctiveAction(); err != nil {
log.Printf("[ERROR] error performing correctiveAction: %v", err)
} else {
// try the command again after a successful correction
stdoutBuf, stderrBuf, err = a.RunCommand(cmd)
if err == nil {
// success
result = stdoutBuf.String()
break
}
}
}

if retries > AverecmdRetryCount {
// failure after exhausted retries
return "", fmt.Errorf("Failure after %d retries applying command: '%s' '%s'", AverecmdRetryCount, stdoutBuf.String(), stderrBuf.String())
Expand Down Expand Up @@ -1449,7 +1458,7 @@ func (a *AvereVfxt) getCreateAzureStorageFilerCommand(azureStorageFiler *AzureSt
}

func (a *AvereVfxt) getDeleteFilerCommand(filer string) string {
return WrapCommandForLogging(fmt.Sprintf("%s corefiler.remove \"%s\"", a.getBaseAvereCmd(), filer), AverecmdLogFile)
return WrapCommandForLogging(fmt.Sprintf("%s system.multicall \"[{'methodName':'system.enableAPI','params':['maintenance']},{'methodName':'corefiler.remove','params':['%s']}]\"", a.getBaseAvereCmd(), filer), AverecmdLogFile)
}

func (a *AvereVfxt) getListCredentialsCommand() string {
Expand Down

0 comments on commit 2f3fd3e

Please sign in to comment.