Skip to content

Commit

Permalink
Merge pull request #91 from ancorgs/any_name
Browse files Browse the repository at this point in the history
Use the new Devicegraph#find_by_any_name
  • Loading branch information
ancorgs committed Jan 9, 2018
2 parents 8a59a09 + d4db05e commit 557d70e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
7 changes: 7 additions & 0 deletions package/yast2-update.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Jan 9 07:09:57 UTC 2018 - ancor@suse.com

- When matching partitions, rely on the new
Y2Storage::Devicegraph#find_by_any_name (bsc#1073254).
- 4.0.5

-------------------------------------------------------------------
Fri Jan 5 07:33:52 UTC 2018 - jsrain@suse.cz

Expand Down
6 changes: 3 additions & 3 deletions package/yast2-update.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-update
Version: 4.0.4
Version: 4.0.5
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand All @@ -42,8 +42,8 @@ BuildRequires: yast2-installation-control
BuildRequires: rubygem(rspec)

BuildRequires: yast2-storage-ng >= 3.3.4
# Y2Storage::BlkDevice.find_by_any_name
Requires: yast2-storage-ng >= 4.0.59
# Y2Storage::Devicegraph#find_by_any_name
Requires: yast2-storage-ng >= 4.0.67
# FSSnapshotStore
Requires: yast2 >= 3.1.126
Requires: yast2-installation
Expand Down
9 changes: 1 addition & 8 deletions src/modules/RootPart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2204,14 +2204,7 @@ def fstab_entry_matches?(entry, filesystem)
# @param blk_dev [Y2Storage::BlkDevice]
# @return [Boolean]
def name_matches_device?(name, blk_dev)
# First try the cheapest alternative: matching against the names directly
# handled by libstorage-ng
known_dev_names = [blk_dev.name] + blk_dev.udev_full_all
return true if known_dev_names.include?(name)

# If the previous didn't match, there is still a chance using the slower
# .find_by_any_name in the probed devicegraph
found = Y2Storage::BlkDevice.find_by_any_name(probed, name)
found = staging.find_by_any_name(name)
return true if found && found.sid == blk_dev.sid

log.warn("Device does not match fstab (name): #{blk_dev.name} not equivalent to #{name}")
Expand Down

0 comments on commit 557d70e

Please sign in to comment.