From 090bc434799272afecc1d13a06883887c25929ee Mon Sep 17 00:00:00 2001 From: Ahmet Alp Balkan Date: Mon, 3 Aug 2015 09:10:21 -0700 Subject: [PATCH] Reconcile publishSettings methods --- management/publishSettings.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/management/publishSettings.go b/management/publishSettings.go index fbba25e2fae1..0285c915fb0a 100644 --- a/management/publishSettings.go +++ b/management/publishSettings.go @@ -17,13 +17,6 @@ func ClientFromPublishSettingsData(settingsData []byte, subscriptionID string) ( return ClientFromPublishSettingsDataWithConfig(settingsData, subscriptionID, DefaultConfig()) } -// ClientFromPublishSettingsDataWithConfig unmarshalls the contents of a publish settings file -// from https://manage.windowsazure.com/publishsettings. -// If subscriptionID is left empty, the first subscription in the string is used. -func ClientFromPublishSettingsDataWithConfig(settingsData []byte, subscriptionID string, config ClientConfig) (client Client, err error) { - return clientFromPublishData(settingsData, subscriptionID, config) -} - // ClientFromPublishSettingsFile reads a publish settings file downloaded from https://manage.windowsazure.com/publishsettings. // If subscriptionID is left empty, the first subscription in the file is used. func ClientFromPublishSettingsFile(filePath, subscriptionID string) (client Client, err error) { @@ -42,10 +35,13 @@ func ClientFromPublishSettingsFileWithConfig(filePath, subscriptionID string, co return client, err } - return clientFromPublishData(publishSettingsContent, subscriptionID, config) + return ClientFromPublishSettingsDataWithConfig(publishSettingsContent, subscriptionID, config) } -func clientFromPublishData(data []byte, subscriptionID string, config ClientConfig) (client Client, err error) { +// ClientFromPublishSettingsDataWithConfig unmarshalls the contents of a publish settings file +// from https://manage.windowsazure.com/publishsettings. +// If subscriptionID is left empty, the first subscription in the string is used. +func ClientFromPublishSettingsDataWithConfig(data []byte, subscriptionID string, config ClientConfig) (client Client, err error) { publishData := publishData{} if err = xml.Unmarshal(data, &publishData); err != nil { return client, err