Skip to content

Commit

Permalink
Name tuple has to be always the last one in the udev rule.
Browse files Browse the repository at this point in the history
SCR's agent orherwise is unable to recognize device name and returns
result in incorrect format.
  • Loading branch information
mchf committed Oct 4, 2016
1 parent d761243 commit 1888237
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/modules/LanItems.rb
Expand Up @@ -430,7 +430,13 @@ def ReplaceItemUdev(replace_key, new_key, new_val)
operator = new_key == "NAME" ? "=" : "=="
current_rule = getUdevFallback
rule = RemoveKeyFromUdevRule(getUdevFallback, replace_key)

# NAME="devname" has to be last in the rule.
# otherwise SCR agent .udev_persistent.net returns crap
# isn't that fun
name_tuple = rule.pop
new_rule = AddToUdevRule(rule, "#{new_key}#{operator}\"#{new_val}\"")
new_rule.push(name_tuple)

log.info("ReplaceItemUdev: new udev rule = #{new_rule}")

Expand Down

0 comments on commit 1888237

Please sign in to comment.