@@ -93,21 +93,20 @@ func loadProviderSchemas(schemas map[addrs.Provider]*ProviderSchema, config *con
9393 var diags tfdiags.Diagnostics
9494
9595 ensure := func (fqn addrs.Provider ) {
96- // TODO: LegacyString() will be removed in an upcoming release
97- typeName := fqn .LegacyString ()
96+ name := fqn .String ()
9897
9998 if _ , exists := schemas [fqn ]; exists {
10099 return
101100 }
102101
103- log .Printf ("[TRACE] LoadSchemas: retrieving schema for provider type %q" , fqn . LegacyString () )
102+ log .Printf ("[TRACE] LoadSchemas: retrieving schema for provider type %q" , name )
104103 provider , err := components .ResourceProvider (fqn )
105104 if err != nil {
106105 // We'll put a stub in the map so we won't re-attempt this on
107106 // future calls.
108107 schemas [fqn ] = & ProviderSchema {}
109108 diags = diags .Append (
110- fmt .Errorf ("Failed to instantiate provider %q to obtain schema: %s" , typeName , err ),
109+ fmt .Errorf ("Failed to instantiate provider %q to obtain schema: %s" , name , err ),
111110 )
112111 return
113112 }
@@ -121,7 +120,7 @@ func loadProviderSchemas(schemas map[addrs.Provider]*ProviderSchema, config *con
121120 // future calls.
122121 schemas [fqn ] = & ProviderSchema {}
123122 diags = diags .Append (
124- fmt .Errorf ("Failed to retrieve schema from provider %q: %s" , typeName , resp .Diagnostics .Err ()),
123+ fmt .Errorf ("Failed to retrieve schema from provider %q: %s" , name , resp .Diagnostics .Err ()),
125124 )
126125 return
127126 }
@@ -138,7 +137,7 @@ func loadProviderSchemas(schemas map[addrs.Provider]*ProviderSchema, config *con
138137 // We're not using the version numbers here yet, but we'll check
139138 // for validity anyway in case we start using them in future.
140139 diags = diags .Append (
141- fmt .Errorf ("invalid negative schema version provider configuration for provider %q" , typeName ),
140+ fmt .Errorf ("invalid negative schema version provider configuration for provider %q" , name ),
142141 )
143142 }
144143
@@ -147,7 +146,7 @@ func loadProviderSchemas(schemas map[addrs.Provider]*ProviderSchema, config *con
147146 s .ResourceTypeSchemaVersions [t ] = uint64 (r .Version )
148147 if r .Version < 0 {
149148 diags = diags .Append (
150- fmt .Errorf ("invalid negative schema version for resource type %s in provider %q" , t , typeName ),
149+ fmt .Errorf ("invalid negative schema version for resource type %s in provider %q" , t , name ),
151150 )
152151 }
153152 }
@@ -158,7 +157,7 @@ func loadProviderSchemas(schemas map[addrs.Provider]*ProviderSchema, config *con
158157 // We're not using the version numbers here yet, but we'll check
159158 // for validity anyway in case we start using them in future.
160159 diags = diags .Append (
161- fmt .Errorf ("invalid negative schema version for data source %s in provider %q" , t , typeName ),
160+ fmt .Errorf ("invalid negative schema version for data source %s in provider %q" , t , name ),
162161 )
163162 }
164163 }
0 commit comments