add error handling to dynamic network configuration
This commit is contained in:
@@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Add EL9 Quickstart guide to index.rst
|
- Add EL9 Quickstart guide to index.rst
|
||||||
- Container file gids are now updated properly during syncuser. #840
|
- Container file gids are now updated properly during syncuser. #840
|
||||||
- Fix build for API.
|
- Fix build for API.
|
||||||
|
- Add error handling to `wwctl`'s dynamic IP configuration attempt.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|||||||
@@ -27,3 +27,4 @@
|
|||||||
* Jeffrey Frey @jtfrey
|
* Jeffrey Frey @jtfrey
|
||||||
* Xu Yang(Jason Yang) <jasonyangshadow@gmail.com> @JasonYangShadow
|
* Xu Yang(Jason Yang) <jasonyangshadow@gmail.com> @JasonYangShadow
|
||||||
* Arnaud LECOMTE <contact@arnaud-lcm.com>
|
* Arnaud LECOMTE <contact@arnaud-lcm.com>
|
||||||
|
* Matt Jolly <Matt.Jolly@footclan.ninja>
|
||||||
|
|||||||
@@ -119,7 +119,10 @@ func (conf *RootConf) SetDynamicDefaults() (err error) {
|
|||||||
|
|
||||||
if conf.Ipaddr == "" {
|
if conf.Ipaddr == "" {
|
||||||
wwlog.Verbose("Configuration has no valid network, going to dynamic values")
|
wwlog.Verbose("Configuration has no valid network, going to dynamic values")
|
||||||
conn, _ := net.Dial("udp", "8.8.8.8:80")
|
conn, err := net.Dial("udp", "8.8.8.8:80")
|
||||||
|
if err != nil {
|
||||||
|
return errors.Wrap(err, "Couldn't establish a connection to remote")
|
||||||
|
}
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
ipaddr = conn.LocalAddr().(*net.UDPAddr).IP
|
ipaddr = conn.LocalAddr().(*net.UDPAddr).IP
|
||||||
mask = ipaddr.DefaultMask()
|
mask = ipaddr.DefaultMask()
|
||||||
|
|||||||
Reference in New Issue
Block a user