Return "" when NetDev.IpCIDR is empty
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
committed by
Christian Goll
parent
ec61ffbacc
commit
87da57d1a2
@@ -412,7 +412,7 @@ Return the ipv4 address and mask in CIDR format. Aimed for the use in
|
||||
templates.
|
||||
*/
|
||||
func (netdev *NetDev) IpCIDR() string {
|
||||
if netdev.Ipaddr.IsUnspecified() || netdev.Netmask.IsUnspecified() {
|
||||
if netdev.Ipaddr == nil || netdev.Ipaddr.IsUnspecified() || netdev.Netmask == nil || netdev.Netmask.IsUnspecified() {
|
||||
return ""
|
||||
}
|
||||
ipCIDR := net.IPNet{
|
||||
|
||||
Reference in New Issue
Block a user