Skip to content

Commit

Permalink
Merge 181a6e6 into 148bd49
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Jun 19, 2020
2 parents 148bd49 + 181a6e6 commit 1a03e69
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions package/yast2-network.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jun 19 13:04:18 UTC 2020 - Knut Anderssen <kanderssen@suse.com>

- Parse correctly udev rules keys using underscores (bsc#1167256)
- 4.2.71

-------------------------------------------------------------------
Mon Jun 15 11:53:03 UTC 2020 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-network.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-network
Version: 4.2.70
Version: 4.2.71
Release: 0
Summary: YaST2 - Network Configuration
License: GPL-2.0-only
Expand Down
2 changes: 1 addition & 1 deletion src/lib/y2network/udev_rule_part.rb
Expand Up @@ -27,7 +27,7 @@ module Y2Network
class UdevRulePart
include Yast::Logger
# Regular expression to match a udev rule part
PART_REGEXP = Regexp.new("\\A(?<key>[A-Za-z\{\}]+)(?<operator>[^\"]+)\"(?<value>.+)\"\\Z")
PART_REGEXP = Regexp.new("\\A(?<key>[A-Za-z\{\}_]+)(?<operator>[^\"]+)\"(?<value>.+)\"\\Z")

class << self
# Returns a rule part from a string
Expand Down
5 changes: 5 additions & 0 deletions test/y2network/udev_rule_part_test.rb
Expand Up @@ -33,6 +33,11 @@
expect(part.key).to eq("ACTION")
expect(part.operator).to eq("==")
expect(part.value).to eq("add")

part = described_class.from_string("ATTR{dev_id}==\"0x0\"")
expect(part.key).to eq("ATTR{dev_id}")
expect(part.operator).to eq("==")
expect(part.value).to eq("0x0")
end

it "returns nil in case of an invalid udev rule" do
Expand Down

0 comments on commit 1a03e69

Please sign in to comment.