datasource: Add FetchNetworkConfig

FetchNetworkConfig is currently only used by ConfigDrive to read the
network config file from the disk.
This commit is contained in:
Alex Crawford
2014-08-18 12:20:25 -07:00
parent c39dd5cc67
commit 604ef7ecb4
9 changed files with 42 additions and 10 deletions

View File

@@ -126,6 +126,10 @@ func (scs *serverContextService) FetchUserdata() ([]byte, error) {
return []byte(userData), nil
}
func (scs *serverContextService) FetchNetworkConfig(a string) ([]byte, error) {
return nil, nil
}
func isBase64Encoded(field string, userdata map[string]string) bool {
base64Fields, ok := userdata["base64_fields"]
if !ok {

View File

@@ -38,6 +38,10 @@ func (ms MetadataService) FetchUserdata() ([]byte, error) {
return ms.FetchData(ms.UserdataUrl())
}
func (ms MetadataService) FetchNetworkConfig(filename string) ([]byte, error) {
return nil, nil
}
func (ms MetadataService) FetchData(url string) ([]byte, error) {
if data, err := ms.Client.GetRetry(url); err == nil {
return data, err