diff options
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/config/module')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/config/module/storage.go | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/vendor/github.com/hashicorp/terraform/config/module/storage.go b/vendor/github.com/hashicorp/terraform/config/module/storage.go index 58e3a10..7734cbc 100644 --- a/vendor/github.com/hashicorp/terraform/config/module/storage.go +++ b/vendor/github.com/hashicorp/terraform/config/module/storage.go | |||
@@ -7,7 +7,6 @@ import ( | |||
7 | "log" | 7 | "log" |
8 | "os" | 8 | "os" |
9 | "path/filepath" | 9 | "path/filepath" |
10 | "strings" | ||
11 | 10 | ||
12 | getter "github.com/hashicorp/go-getter" | 11 | getter "github.com/hashicorp/go-getter" |
13 | "github.com/hashicorp/terraform/registry" | 12 | "github.com/hashicorp/terraform/registry" |
@@ -101,21 +100,6 @@ func (s Storage) loadManifest() (moduleManifest, error) { | |||
101 | if err := json.Unmarshal(data, &manifest); err != nil { | 100 | if err := json.Unmarshal(data, &manifest); err != nil { |
102 | return manifest, err | 101 | return manifest, err |
103 | } | 102 | } |
104 | |||
105 | for i, rec := range manifest.Modules { | ||
106 | // If the path was recorded before we changed to always using a | ||
107 | // slash as separator, we delete the record from the manifest so | ||
108 | // it can be discovered again and will be recorded using a slash. | ||
109 | if strings.Contains(rec.Dir, "\\") { | ||
110 | manifest.Modules[i] = manifest.Modules[len(manifest.Modules)-1] | ||
111 | manifest.Modules = manifest.Modules[:len(manifest.Modules)-1] | ||
112 | continue | ||
113 | } | ||
114 | |||
115 | // Make sure we use the correct path separator. | ||
116 | rec.Dir = filepath.FromSlash(rec.Dir) | ||
117 | } | ||
118 | |||
119 | return manifest, nil | 103 | return manifest, nil |
120 | } | 104 | } |
121 | 105 | ||
@@ -146,9 +130,6 @@ func (s Storage) recordModule(rec moduleRecord) error { | |||
146 | } | 130 | } |
147 | } | 131 | } |
148 | 132 | ||
149 | // Make sure we always use a slash separator. | ||
150 | rec.Dir = filepath.ToSlash(rec.Dir) | ||
151 | |||
152 | manifest.Modules = append(manifest.Modules, rec) | 133 | manifest.Modules = append(manifest.Modules, rec) |
153 | 134 | ||
154 | js, err := json.Marshal(manifest) | 135 | js, err := json.Marshal(manifest) |
@@ -331,7 +312,7 @@ func (s Storage) findRegistryModule(mSource, constraint string) (moduleRecord, e | |||
331 | // we need to lookup available versions | 312 | // we need to lookup available versions |
332 | // Only on Get if it's not found, on unconditionally on Update | 313 | // Only on Get if it's not found, on unconditionally on Update |
333 | if (s.Mode == GetModeGet && !found) || (s.Mode == GetModeUpdate) { | 314 | if (s.Mode == GetModeGet && !found) || (s.Mode == GetModeUpdate) { |
334 | resp, err := s.registry.Versions(mod) | 315 | resp, err := s.registry.ModuleVersions(mod) |
335 | if err != nil { | 316 | if err != nil { |
336 | return rec, err | 317 | return rec, err |
337 | } | 318 | } |
@@ -351,7 +332,7 @@ func (s Storage) findRegistryModule(mSource, constraint string) (moduleRecord, e | |||
351 | 332 | ||
352 | rec.Version = match.Version | 333 | rec.Version = match.Version |
353 | 334 | ||
354 | rec.url, err = s.registry.Location(mod, rec.Version) | 335 | rec.url, err = s.registry.ModuleLocation(mod, rec.Version) |
355 | if err != nil { | 336 | if err != nil { |
356 | return rec, err | 337 | return rec, err |
357 | } | 338 | } |