Skip to content

Commit

Permalink
Merge pull request #182 from ahmetalpbalkan/pubSettings
Browse files Browse the repository at this point in the history
Reconcile publishSettings methods
  • Loading branch information
ahmetb committed Aug 3, 2015
2 parents 0a2626d + 090bc43 commit 99b5c36
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions management/publishSettings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down

0 comments on commit 99b5c36

Please sign in to comment.