Skip to content

Commit

Permalink
Merge pull request #327 from s-urbaniak/openstack-fix
Browse files Browse the repository at this point in the history
openstack: fix dispatcher
  • Loading branch information
crawford authored Feb 22, 2017
2 parents d62a679 + 13516ca commit ce11469
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/providers/openstack/openstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func FetchConfig(logger *log.Logger, client *resource.HttpClient) (types.Config,
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)

dispatch := func(name string, fn func() ([]byte, error)) {
raw, err := fetchConfigFromConfigDrive(logger, ctx)
raw, err := fn()
if err != nil {
switch err {
case context.Canceled:
Expand All @@ -75,6 +75,7 @@ func FetchConfig(logger *log.Logger, client *resource.HttpClient) (types.Config,
go dispatch("config drive", func() ([]byte, error) {
return fetchConfigFromConfigDrive(logger, ctx)
})

go dispatch("metadata service", func() ([]byte, error) {
return fetchConfigFromMetadataService(logger, client, ctx)
})
Expand Down

0 comments on commit ce11469

Please sign in to comment.