forked from hashicorp/terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I made this interface way back with the original backend work and I guess I forgot to hook it up! This is becoming an issue as I'm working on our 2nd enhanced backend that requires this information and I realized it was hardcoded before. This propertly uses the CLIInit interface allowing any backend to gain access to this data.
- Loading branch information
Showing
5 changed files
with
59 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package local | ||
|
||
import ( | ||
"github.com/hashicorp/terraform/backend" | ||
) | ||
|
||
// backend.CLI impl. | ||
func (b *Local) CLIInit(opts *backend.CLIOpts) error { | ||
b.CLI = opts.CLI | ||
b.CLIColor = opts.CLIColor | ||
b.ContextOpts = opts.ContextOpts | ||
b.OpInput = opts.Input | ||
b.OpValidation = opts.Validation | ||
|
||
// Only configure state paths if we didn't do so via the configure func. | ||
if b.StatePath == "" { | ||
b.StatePath = opts.StatePath | ||
b.StateOutPath = opts.StateOutPath | ||
b.StateBackupPath = opts.StateBackupPath | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters