Skip to content

Commit

Permalink
Merge pull request #396 from joseivanlopez/partitioner_multipath
Browse files Browse the repository at this point in the history
Partitioner multipath fixes
  • Loading branch information
joseivanlopez committed Oct 27, 2017
2 parents 836ce4c + 12184cf commit 537abc9
Show file tree
Hide file tree
Showing 40 changed files with 927 additions and 111 deletions.
3 changes: 3 additions & 0 deletions doc/user-stories/expert-partitioner.md
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,9 @@ The specs are based on current version of expert partitioner for TW. The goal is
* shows dialog to edit the current selected LV in the table
* same dialog than partition edition (see above)
* 'File System Id' is not shown
* *(pending) and selected LV is a thin pool*
* shows an error popup
* does not allow to edit the LV
* *(pending) and action 'Resize' is selected*
* shows popup dialog to resize the current selected LV in the table
* *(pending) and action 'Delete' is selected*
Expand Down
8 changes: 8 additions & 0 deletions package/yast2-storage-ng.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Oct 25 17:28:48 UTC 2017 - jlopez@suse.com

- Partitioner: allow to work with multipath devices.
- bsc#1058373 and bsc#1028853.
- Part of fate#318196.
- 4.0.12

-------------------------------------------------------------------
Wed Oct 25 13:12:37 UTC 2017 - igonzalezsosa@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.0.11
Version: 4.0.12
Release: 0
BuildArch: noarch

Expand Down
1 change: 0 additions & 1 deletion src/clients/inst_prepdisk.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
# encoding: utf-8

# Copyright (c) [2016] SUSE LLC
Expand Down
3 changes: 2 additions & 1 deletion src/lib/y2partitioner/sequences/add_md.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
require "y2partitioner/sequences/transaction_wizard"
require "y2partitioner/sequences/new_blk_device"
require "y2partitioner/sequences/controllers"
require "y2partitioner/dialogs"
require "y2partitioner/dialogs/md"
require "y2partitioner/dialogs/md_options"

module Y2Partitioner
module Sequences
Expand Down
24 changes: 23 additions & 1 deletion src/lib/y2partitioner/sequences/add_partition.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# encoding: utf-8

# Copyright (c) [2017] SUSE LLC
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, contact SUSE LLC.
#
# To contact SUSE LLC about this file by physical or electronic mail, you may
# find current contact information at www.suse.com.

require "yast"
require "y2partitioner/sequences/transaction_wizard"
require "y2partitioner/sequences/new_blk_device"
Expand All @@ -12,8 +33,9 @@ class AddPartition < TransactionWizard

# @param disk_name [String]
def initialize(disk_name)
super()
textdomain "storage"

super()
@part_controller = Controllers::Partition.new(disk_name)
end

Expand Down
4 changes: 2 additions & 2 deletions src/lib/y2partitioner/sequences/controllers/partition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ def initialize(disk_name)
end

# Device being partitioned
# @return [Y2Storage::Disk]
# @return [Y2Storage::BlkDevice]
def disk
dg = DeviceGraphs.instance.current
Y2Storage::Disk.find_by_name(dg, disk_name)
Y2Storage::BlkDevice.find_by_name(dg, disk_name)
end

# Available slots to create the partition
Expand Down
23 changes: 23 additions & 0 deletions src/lib/y2partitioner/sequences/edit_blk_device.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# encoding: utf-8

# Copyright (c) [2017] SUSE LLC
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, contact SUSE LLC.
#
# To contact SUSE LLC about this file by physical or electronic mail, you may
# find current contact information at www.suse.com.

require "yast"
require "y2partitioner/sequences/transaction_wizard"
require "y2partitioner/sequences/controllers"
Expand All @@ -11,6 +32,8 @@ module Sequences
class EditBlkDevice < TransactionWizard
# @param blk_device [Y2Storage::BlkDevice]
def initialize(blk_device)
textdomain "storage"

super()
@blk_device = blk_device
@fs_controller = Controllers::Filesystem.new(blk_device, title)
Expand Down
21 changes: 21 additions & 0 deletions src/lib/y2partitioner/ui_state.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# encoding: utf-8

# Copyright (c) [2017] SUSE LLC
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, contact SUSE LLC.
#
# To contact SUSE LLC about this file by physical or electronic mail, you may
# find current contact information at www.suse.com.

require "y2partitioner/widgets/pages/md_raids"
require "y2partitioner/widgets/pages/lvm"

Expand Down
1 change: 1 addition & 0 deletions src/lib/y2partitioner/widgets/add_lvm_button.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def initialize(table)

# @macro seeAbstractWidget
def label
# TRANSLATORS: button label to add a volume group or logical volume
_("Add...")
end

Expand Down
1 change: 1 addition & 0 deletions src/lib/y2partitioner/widgets/add_lvm_lv_button.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def initialize(vg)

# @macro seeAbstractWidget
def label
# TRANSLATORS: button label to add a logical volume
_("Add...")
end

Expand Down
23 changes: 23 additions & 0 deletions src/lib/y2partitioner/widgets/btrfs_subvolumes_add_button.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# encoding: utf-8

# Copyright (c) [2017] SUSE LLC
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, contact SUSE LLC.
#
# To contact SUSE LLC about this file by physical or electronic mail, you may
# find current contact information at www.suse.com.

require "yast"
require "cwm"
require "y2partitioner/device_graphs"
Expand All @@ -17,7 +38,9 @@ def initialize(table)
@table = table
end

# @macro seeAbstractWidget
def label
# TRANSLATORS: button label to add a btrfs subvolume
_("Add...")
end

Expand Down
23 changes: 23 additions & 0 deletions src/lib/y2partitioner/widgets/btrfs_subvolumes_delete_button.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# encoding: utf-8

# Copyright (c) [2017] SUSE LLC
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, contact SUSE LLC.
#
# To contact SUSE LLC about this file by physical or electronic mail, you may
# find current contact information at www.suse.com.

require "yast"
require "cwm"
require "y2partitioner/widgets/btrfs_subvolumes_table"
Expand All @@ -19,7 +40,9 @@ def initialize(table)
end

# Widget label
# @macro seeAbstractWidget
def label
# TRANSLATORS: button label to delete a btrfs subvolume
_("Delete...")
end

Expand Down
35 changes: 32 additions & 3 deletions src/lib/y2partitioner/widgets/configurable_blk_devices_table.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
# encoding: utf-8

# Copyright (c) [2017] SUSE LLC
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, contact SUSE LLC.
#
# To contact SUSE LLC about this file by physical or electronic mail, you may
# find current contact information at www.suse.com.

require "yast"
require "cwm/table"

require "y2partitioner/device_graphs"
require "y2partitioner/ui_state"
require "y2partitioner/widgets/blk_devices_table"

module Y2Partitioner
Expand Down Expand Up @@ -33,10 +53,19 @@ def init
self.value = row_id(initial_sid) if initial_sid
end

# Jumps to the page associated to the selected device
#
# @note Event is launched after double clicking over a row.
#
# @macro seeAbstractWidget
def handle
id = value[/table:(.*)/, 1]
@pager.handle("ID" => id)
device = selected_device
return nil if device.nil?

page = pager.device_page(device)
return nil if page.nil?

pager.handle("ID" => page.widget_id)
end

# Device object selected in the table
Expand Down
Loading

0 comments on commit 537abc9

Please sign in to comment.