Skip to content

Commit 18da7cf

Browse files
committed
mantle: openstack: add a few comments about LoadCloudsYAML
This will add some context so a user might know where to look on why this was done and how it works.
1 parent 0caf46b commit 18da7cf

File tree

1 file changed

+5
-0
lines changed
  • mantle/platform/api/openstack

1 file changed

+5
-0
lines changed

mantle/platform/api/openstack/api.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ type API struct {
8585

8686
// LoadCloudsYAML defines how to load a clouds.yaml file.
8787
// By default, this calls the local LoadCloudsYAML function.
88+
// See https://github.com/gophercloud/utils/blob/master/openstack/clientconfig/requests.go
8889
func (opts Options) LoadCloudsYAML() (map[string]clientconfig.Cloud, error) {
90+
// If provided a path to a config file then we load it here.
8991
if opts.ConfigPath != "" {
9092
var clouds clientconfig.Clouds
9193
if content, err := ioutil.ReadFile(opts.ConfigPath); err != nil {
@@ -95,6 +97,9 @@ func (opts Options) LoadCloudsYAML() (map[string]clientconfig.Cloud, error) {
9597
}
9698
return clouds.Clouds, nil
9799
}
100+
101+
// If not provided a path to a config, fall back to
102+
// LoadCloudsYAML() from the clientconfig library.
98103
return clientconfig.LoadCloudsYAML()
99104
}
100105

0 commit comments

Comments
 (0)