Refactor #29378
Updated by Lukas Zapletal over 5 years ago
Equality of DHCP records is poorly defined as arbitrary hash named "options" is used. Various implementations parse/fetch various DHCP options into the hash while SmartProxy DHCP API only defines few options (hostname, filename, ip, mac). options. In the reported problem, ISC DHCP configuration file parser also adds "hardware_type" option (set to "ethernet") while newly created DHCP record don't have this option. Comparsion of the two same DHCP records fails which lead to DHCP conflict. The solution is either to add hardware_type to This all DHCP Record instances for ISC DHCP or stems from the fact that Ruby programers tend to remove it when overuse hash where the proper data structure is parsed, because simply struct. To avoid harsh refactoring of all DHCP implementation, the equality operation can be redefined in a way that only "ethernet" hardware type is supported at the moment. particular DHCP options are tested for equality. This is hardcoded in solves the code, therefore I lean towards problem and helps to better define which fields are actually expected by the latter solution. contract.