Skip to content

Commit

Permalink
Merge pull request #1220 from yast/sw_52
Browse files Browse the repository at this point in the history
try harder matching device names (bsc#1186268)
  • Loading branch information
wfeldt committed Jun 7, 2021
2 parents ab68801 + 5df61a3 commit 03cf5ec
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
6 changes: 6 additions & 0 deletions package/yast2-storage-ng.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jun 4 12:07:22 UTC 2021 - Steffen Winterfeldt <snwint@suse.com>

- try harder matching device names (bsc#1186268)
- 4.3.52

-------------------------------------------------------------------
Thu May 20 08:42:54 UTC 2021 - Knut Anderssen <kanderssen@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-storage-ng.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#

Name: yast2-storage-ng
Version: 4.3.51
Version: 4.3.52
Release: 0
Summary: YaST2 - Storage Configuration
License: GPL-2.0-only OR GPL-3.0-only
Expand Down
5 changes: 2 additions & 3 deletions src/lib/y2storage/filesystems/blk_filesystem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,8 @@ def match_fstab_spec?(spec)
return !Regexp.last_match(1).empty? && label == Regexp.last_match(1)
end

blk_devices.any? do |dev|
dev.name == spec || dev.udev_full_all.include?(spec)
end
named_device = devicegraph.find_by_any_name(spec)
blk_devices.include?(named_device)
end

# Whether it makes sense modify the attribute about snapper configuration
Expand Down
16 changes: 16 additions & 0 deletions test/y2storage/filesystems/blk_filesystem_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,22 @@
end
end
end

context "when the udev name has to be looked up externally" do
let(:scenario) { "lvm-disk-as-pv.xml" }
let(:dev_name) { "/dev/system/boot" }
let(:dev_name_alternative) { "/dev/mapper/system-boot" }

before do
allow(Y2Storage::BlkDevice).to receive(:find_by_any_name)
.with(fake_devicegraph, dev_name_alternative)
.and_return(Y2Storage::BlkDevice.find_by_name(fake_devicegraph, dev_name))
end

it "returns true if the udev name matches" do
expect(filesystem.match_fstab_spec?(dev_name_alternative)).to eq true
end
end
end

describe "#display_name" do
Expand Down

0 comments on commit 03cf5ec

Please sign in to comment.