Skip to content

Commit

Permalink
Merge pull request #484 from teclator/network-fixregexp
Browse files Browse the repository at this point in the history
fixed Yast::NetworkInterfaces.FilterNOT regexp matching (bsc#990482)
  • Loading branch information
teclator committed Jul 25, 2016
2 parents 4867e3c + 090b4dc commit 8763f9b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library/network/src/modules/NetworkInterfaces.rb
Expand Up @@ -838,7 +838,7 @@ def FilterNOT(devices, devregex)
regex = "^(#{@DeviceRegex[devregex] || devregex})[0-9]*$"

log.debug("regex=#{regex}")
devices.select! { |f, _d| f !~ regex }
devices.select! { |f, _d| f !~ /#{regex}/ }

log.debug("devices=#{devices}")
devices
Expand Down
21 changes: 21 additions & 0 deletions library/network/test/network_interfaces_test.rb
Expand Up @@ -91,6 +91,27 @@
end
end

describe "#FilterNOT" do
let(:data_dir) { File.join(File.dirname(__FILE__), "data") }
# Defined in test/data/etc/sysconfig/ifcfg-*
let(:devices) { ["arc", "bond", "br", "em", "eth", "ppp", "vlan"] }

around do |example|
change_scr_root(data_dir, &example)
end

before do
subject.CleanCacheRead
end

context "given a list of device types and a regex" do
it "returns device types that don't match the given regex" do
expect(subject.FilterNOT(subject.FilterDevices(""), "eth").keys)
.to eql(["arc", "bond", "br", "em", "ppp", "vlan"])
end
end
end

describe "#ConcealSecrets1" do
let(:ifcfg_out) do
{
Expand Down
7 changes: 7 additions & 0 deletions package/yast2.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Jul 25 14:27:58 UTC 2016 - kanderssen@suse.com

- Fixed Yast::NetworkInterfaces.FilterNOT regexp matching
(bsc#990482) added in previous release.
- 3.1.198

-------------------------------------------------------------------
Mon Jul 25 10:42:29 UTC 2016 - kanderssen@suse.com

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


Name: yast2
Version: 3.1.197
Version: 3.1.198
Release: 0
Summary: YaST2 - Main Package
License: GPL-2.0
Expand Down

0 comments on commit 8763f9b

Please sign in to comment.