Skip to content

Commit

Permalink
LanItems#clear_set_hostname returns list of cleared configs
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf authored and teclator committed Jan 24, 2017
1 parent 9c24bb7 commit c4b81fd
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/modules/LanItems.rb
Expand Up @@ -2499,8 +2499,12 @@ def conf_set_hostname(device)

# Removes DHCLIENT_SET_HOSTNAME from all ifcfgs
#
# @return [void]
# @return [Array<String>] list of names of cleared devices
def clear_set_hostname
log.info("Clearing DHCLIENT_SET_HOSTNAME flag from device configs")

ret = []

GetNetcardInterfaces().each do |item_id|
dev_map = GetDeviceMap(item_id)
next if dev_map.nil? || dev_map.empty?
Expand All @@ -2510,7 +2514,13 @@ def clear_set_hostname

SetDeviceMap(item_id, dev_map)
SetModified()

ret << GetDeviceName(item_id)
end

log.info("#{ret.inspect} use default DHCLIENT_SET_HOSTNAME")

ret
end

# This helper allows YARD to extract DSL-defined attributes.
Expand Down

0 comments on commit c4b81fd

Please sign in to comment.