Merge pull request #233 from crawford/configdrive
configdrive: don't fail if no network config was provided
This commit is contained in:
		| @@ -163,7 +163,7 @@ func main() { | ||||
| 		os.Exit(1) | ||||
| 	} | ||||
|  | ||||
| 	if ccm != nil && ccm.NetworkConfigPath != "" { | ||||
| 	if ccm != nil && flags.convertNetconf != "" { | ||||
| 		fmt.Printf("Fetching network config from datasource of type %q\n", ds.Type()) | ||||
| 		netconfBytes, err := ds.FetchNetworkConfig(ccm.NetworkConfigPath) | ||||
| 		if err != nil { | ||||
|   | ||||
| @@ -42,6 +42,9 @@ func (cd *configDrive) FetchUserdata() ([]byte, error) { | ||||
| } | ||||
|  | ||||
| func (cd *configDrive) FetchNetworkConfig(filename string) ([]byte, error) { | ||||
| 	if filename == "" { | ||||
| 		return []byte{}, nil | ||||
| 	} | ||||
| 	return cd.tryReadFile(path.Join(cd.openstackRoot(), filename)) | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user