diff --git a/coreos-cloudinit.go b/coreos-cloudinit.go index 16c7035..81b7d10 100644 --- a/coreos-cloudinit.go +++ b/coreos-cloudinit.go @@ -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 { diff --git a/datasource/configdrive/configdrive.go b/datasource/configdrive/configdrive.go index 81d401e..0dea221 100644 --- a/datasource/configdrive/configdrive.go +++ b/datasource/configdrive/configdrive.go @@ -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)) }