cloudprovider: use ProviderConfig

This commit is contained in:
Yousong Zhou
2020-03-25 17:16:35 +08:00
parent e2826b1338
commit 8009857c8a
19 changed files with 116 additions and 53 deletions
+2 -2
View File
@@ -76,8 +76,8 @@ func (self *SZStackProviderFactory) ValidateUpdateCloudaccountCredential(ctx con
return output, nil
}
func (self *SZStackProviderFactory) GetProvider(providerId, providerName, url, username, password string) (cloudprovider.ICloudProvider, error) {
client, err := zstack.NewZStackClient(providerId, providerName, url, username, password, false)
func (self *SZStackProviderFactory) GetProvider(cfg cloudprovider.ProviderConfig) (cloudprovider.ICloudProvider, error) {
client, err := zstack.NewZStackClient(cfg.Id, cfg.Name, cfg.URL, cfg.Account, cfg.Secret, false)
if err != nil {
return nil, err
}