configdrive: check the network config path
Check to make sure that a network config path has been specified before trying to read from it. Otherwise, it will end up trying to read a directory.
This commit is contained in:
parent
47ac4f6931
commit
987aa21883
@ -69,7 +69,9 @@ func (cd *configDrive) FetchMetadata() (metadata datasource.Metadata, err error)
|
|||||||
|
|
||||||
metadata.SSHPublicKeys = m.SSHAuthorizedKeyMap
|
metadata.SSHPublicKeys = m.SSHAuthorizedKeyMap
|
||||||
metadata.Hostname = m.Hostname
|
metadata.Hostname = m.Hostname
|
||||||
metadata.NetworkConfig, err = cd.tryReadFile(path.Join(cd.openstackRoot(), m.NetworkConfig.ContentPath))
|
if m.NetworkConfig.ContentPath != "" {
|
||||||
|
metadata.NetworkConfig, err = cd.tryReadFile(path.Join(cd.openstackRoot(), m.NetworkConfig.ContentPath))
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user