Skip to content

Commit 7297806

Browse files
authored
clouds: support clouds.yml in addition to clouds.yaml (#142)
While not clearly documented, the native openstacksdk package supports both extensions. This brings parity with the official Python SDK.
1 parent ef82cbe commit 7297806

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

openstack/clientconfig/utils.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,27 @@ func FindAndReadCloudsYAML() (string, []byte, error) {
108108
}
109109
}
110110

111-
return FindAndReadYAML("clouds.yaml")
111+
s, b, err := FindAndReadYAML("clouds.yaml")
112+
if s == "" {
113+
return FindAndReadYAML("clouds.yml")
114+
}
115+
return s, b, err
112116
}
113117

114118
func FindAndReadPublicCloudsYAML() (string, []byte, error) {
115-
return FindAndReadYAML("clouds-public.yaml")
119+
s, b, err := FindAndReadYAML("clouds-public.yaml")
120+
if s == "" {
121+
return FindAndReadYAML("clouds-public.yml")
122+
}
123+
return s, b, err
116124
}
117125

118126
func FindAndReadSecureCloudsYAML() (string, []byte, error) {
119-
return FindAndReadYAML("secure.yaml")
127+
s, b, err := FindAndReadYAML("secure.yaml")
128+
if s == "" {
129+
return FindAndReadYAML("secure.yml")
130+
}
131+
return s, b, err
120132
}
121133

122134
func FindAndReadYAML(yamlFile string) (string, []byte, error) {

0 commit comments

Comments
 (0)