19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File '../../src/include/dhcp-server/misc.rb', line 19
def UpdateSubnetDeclaration(old_iface, new_iface)
old = DhcpServer.GetInterfaceInformation(old_iface)
Builtins.y2error("Old: %1", old)
new = DhcpServer.GetInterfaceInformation(new_iface)
Builtins.y2error("New: %1", new)
old_id = Ops.add(
Ops.add(Ops.get_string(old, "network", ""), " netmask "),
Ops.get_string(old, "netmask", "")
)
new_id = Ops.add(
Ops.add(Ops.get_string(new, "network", ""), " netmask "),
Ops.get_string(new, "netmask", "")
)
Builtins.y2error("Old: %1", old_id)
Builtins.y2error("New: %1", new_id)
return true if !DhcpServer.ExistsEntry("subnet", old_id)
DhcpServer.ChangeEntry("subnet", old_id, "subnet", new_id)
end
|