Show Terraform version on state version mismatch.

This commit is contained in:
Trevor Pounds 2016-06-27 10:45:42 -07:00
parent 85ccf3b6b4
commit 5932214f0d
1 changed files with 6 additions and 6 deletions

View File

@ -1493,8 +1493,8 @@ func ReadState(src io.Reader) (*State, error) {
} }
return v3State, nil return v3State, nil
default: default:
return nil, fmt.Errorf("State version %d not supported, please update.", return nil, fmt.Errorf("Terraform %s does not support state version %d, please update.",
versionIdentifier.Version) SemVersion.String(), versionIdentifier.Version)
} }
} }
@ -1521,8 +1521,8 @@ func ReadStateV2(jsonBytes []byte) (*State, error) {
// Check the version, this to ensure we don't read a future // Check the version, this to ensure we don't read a future
// version that we don't understand // version that we don't understand
if state.Version > StateVersion { if state.Version > StateVersion {
return nil, fmt.Errorf("State version %d not supported, please update.", return nil, fmt.Errorf("Terraform %s does not support state version %d, please update.",
state.Version) SemVersion.String(), state.Version)
} }
// Make sure the version is semantic // Make sure the version is semantic
@ -1553,8 +1553,8 @@ func ReadStateV3(jsonBytes []byte) (*State, error) {
// Check the version, this to ensure we don't read a future // Check the version, this to ensure we don't read a future
// version that we don't understand // version that we don't understand
if state.Version > StateVersion { if state.Version > StateVersion {
return nil, fmt.Errorf("State version %d not supported, please update.", return nil, fmt.Errorf("Terraform %s does not support state version %d, please update.",
state.Version) SemVersion.String(), state.Version)
} }
// Make sure the version is semantic // Make sure the version is semantic