lib/wire/model/network_validation.rb
# ensures that if a network has dhcp set, its :start/:end address
# ranges are within the address range of network, and a hostip is
# given (for dnsmasq to udp-listen on it)
# rubocop:disable CyclomaticComplexity
ensures that if a network has dhcp set, its :start/:end address
ranges are within the address range of network, and a hostip is
given (for dnsmasq to udp-listen on it)
rubocop:disable CyclomaticComplexity
ensures that if a network has dhcp set its : start / : end address ranges are within the address range of network and a hostip is given ( for dnsmasq to udp - listen on it ) rubocop : disable CyclomaticComplexity
def dhcp_address_ranges_valid?
      @project.get_element('networks').each do |network_name, network_data|
        network = network_data[:network]
        dhcp_data = network_data[:dhcp]
        next unless network && dhcp_data
        host_ip = network_data[:hostip]
        if !host_ip
          mark("Network #{network_name} wants dhcp, but does not include a hostip.",
               'network', network_name)
          return false
        else
          if !dhcp_data[:start] || !dhcp_data[:end]
            mark("Network #{network_name} wants dhcp, but does not include an " \
                 'address range. Set :start, :end.',
                 'network', network_name)
            return false
          else
            check_network_ip_ranges(dhcp_data, network, network_name)
          end
        end
      end
    end
def dhcp_address_ranges_valid? @project . get_element ( 'networks' ) . each do | network_name , network_data | network = network_data [ :network ] dhcp_data = network_data [ :dhcp ] next unless network && dhcp_data host_ip = network_data [ :hostip ] if ! host_ip mark ( "Network #{network_name} wants dhcp, but does not include a hostip." , 'network' , network_name ) return false else if ! dhcp_data [ :start ] || ! dhcp_data [ :end ] mark ( "Network #{network_name} wants dhcp, but does not include an " 'address range. Set :start, :end.' , 'network' , network_name ) return false else check_network_ip_ranges ( dhcp_data , network , network_name ) end end end end
ensures that if a network has dhcp set, its :start/:end address
ranges are within the address range of network, and a hostip is
given (for dnsmasq to udp-listen on it)
rubocop:disable CyclomaticComplexity
ensures that if a network has dhcp set its : start / : end address ranges are within the address range of network and a hostip is given ( for dnsmasq to udp - listen on it ) rubocop : disable CyclomaticComplexity
# do we have a host-ip on this bridge?