Skip to content

Commit

Permalink
Improvements from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs committed Nov 2, 2023
1 parent 719a4f2 commit 6839a65
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
14 changes: 7 additions & 7 deletions src/lib/y2storage/encryption_processes/tpm_fde_tools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ class TpmFdeTools < Base
KEY_FILE_NAME = "/.fde-virtual.key".freeze
private_constant :KEY_FILE_NAME

# Content of the third column of crypttab for all involved devices
#
# @return [String]
def self.key_file_name
KEY_FILE_NAME.dup
end

# Class methods
class << self
# List of all block devices configured by fde-tools during system installation
attr_accessor :devices

# Content of the third column of crypttab for all involved devices
#
# @return [String]
def key_file_name
KEY_FILE_NAME.dup
end
end

# Creates an encryption layer over the given block device
Expand Down
12 changes: 5 additions & 7 deletions src/lib/y2storage/yast_feature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@

require "yast"
require "y2storage/feature"
require "yast2/equatable"

module Y2Storage
# Analogous to {StorageFeature}, but for requirements originated by Y2Storage and not
# from libstorage-ng.
class YastFeature < Feature
include Yast2::Equatable

eql_attr :id

# Constructor
def initialize(id, mandatory_pkgs, optional_pkgs)
pkgs = mandatory_pkgs.map { |pkg| Package.new(pkg, optional: false) }
Expand All @@ -50,12 +55,5 @@ def self.all
def self.drop_cache
all.each(&:drop_cache)
end

# @return [Boolean]
def ==(other)
other.class == self.class && other.id == id
end

alias_method :eql?, :==
end
end

0 comments on commit 6839a65

Please sign in to comment.