Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partitioner multipath fixes #396

Merged
merged 23 commits into from
Oct 27, 2017

Conversation

joseivanlopez
Copy link
Contributor

@@ -24,18 +46,17 @@ def initialize(device: nil, table: nil, device_graph: nil)
@device_graph = device_graph
end

# @macro seeAbstractWidget
def label
_("Delete...")
Copy link
Member

@lslezak lslezak Oct 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment for translators to get the context of the text, e.g.

# TRANSLATORS: push button label (or whatever it actually is...)

It might be tricky to translate it correctly...

@yast yast deleted a comment from coveralls Oct 26, 2017
@yast yast deleted a comment from coveralls Oct 26, 2017
@yast yast deleted a comment from coveralls Oct 26, 2017
# @return [Array<Y2Storage::BlkDevice>]
def disk_devices
disk_types = [Y2Storage::Disk, Y2Storage::Dasd, Y2Storage::Multipath]
device_graph.disk_devices.select { |d| disk_types.include?(d.class) }
Copy link
Contributor

@ancorgs ancorgs Oct 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this be nicer (more duck-typed and more robust for inheritance) like?

device_graph.disk_devices.select { |d| d.is?(:disk, :dasd, :multipath) }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, I did not remember the multiparams ability of #is?.


module Y2Partitioner
module Widgets
# Class to represent a tab with a list of devices beloging to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: belonging


private

# Returns a table with all devices used by a MD raid
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"by a MD array" -> "by the container device"

# @note An error popup is shown when there is no partition.
#
# @return [Boolean]
def not_empty_partitions_validation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I find the name (and, in general, how this validations are structured) a little bit confusing. What about, for example?

def delete_validations
  if device.is?(:partition)
    validate_presence
  else
    validate_presence && validate_empty_table
  end
end

# This is your #not_empty_partitions_validation, but it will never be called if this is a partition
def validate_empty_table
  partition_table = device.partition_table
  blah, blah
end

As a bonus, you wouldn't need to add support for is?(:partitionable) which is something that does not makes me specially happy.

Wed Oct 25 17:28:48 UTC 2017 - jlopez@suse.com

- Partitioner: allow to work with multipath devices.
- Part of fate#318196.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't bug#1058373 be mentioned here as well?

@yast yast deleted a comment from coveralls Oct 27, 2017
#
# @note Shadowing for BtrFS subvolumes is always refreshed.
# @see Y2Storage::Filesystems::Btrfs.refresh_subvolumes_shadowing
#
# @param device [Y2Storage::BlkDevice]
def delete_device(device)
if device.is?(:disk)
if device.is?(:partitionable)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does is?(:partitionable) work?

@yast yast deleted a comment from coveralls Oct 27, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 95.528% when pulling 12184cf on joseivanlopez:partitioner_multipath into 836ce4c on yast:master.

Copy link
Contributor

@ancorgs ancorgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@joseivanlopez joseivanlopez merged commit 537abc9 into yast:master Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants