github.com/axw/juju@v0.0.0-20161005053422-4bd6544d08d4/storage/provider/common.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package provider 5 6 import ( 7 "github.com/juju/errors" 8 9 "github.com/juju/juju/storage" 10 ) 11 12 var ( 13 errNoMountPoint = errors.New("filesystem mount point not specified") 14 15 commonStorageProviders = map[storage.ProviderType]storage.Provider{ 16 LoopProviderType: &loopProvider{logAndExec}, 17 RootfsProviderType: &rootfsProvider{logAndExec}, 18 TmpfsProviderType: &tmpfsProvider{logAndExec}, 19 } 20 ) 21 22 // CommonStorageProviders returns a storage.ProviderRegistry that contains 23 // the common storage providers. 24 func CommonStorageProviders() storage.ProviderRegistry { 25 return storage.StaticProviderRegistry{commonStorageProviders} 26 } 27 28 // ValidateConfig performs storage provider config validation, including 29 // any common validation. 30 func ValidateConfig(p storage.Provider, cfg *storage.Config) error { 31 return p.ValidateConfig(cfg) 32 }