Skip to content

Commit

Permalink
Use Devicegraph#find_by_any_name
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs committed Jan 9, 2018
1 parent 8a59a09 commit f23d565
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package/yast2-update.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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 f23d565

Please sign in to comment.