From 70a3cde0f470b99a398e94a27789e8b8f7eb78b9 Mon Sep 17 00:00:00 2001 From: Ahmed Kamal Date: Tue, 25 Aug 2015 01:51:07 +0300 Subject: [PATCH] Show warning message after choosing LVM partition --- app/controllers/disk_wizard_controller.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/controllers/disk_wizard_controller.rb b/app/controllers/disk_wizard_controller.rb index 5e174b9..d907b2c 100644 --- a/app/controllers/disk_wizard_controller.rb +++ b/app/controllers/disk_wizard_controller.rb @@ -10,6 +10,8 @@ class DiskWizardController < ApplicationController DELETE_OPTION = '2' CREATE_OPTION = '3' + LVM_FSTYPE = "LVM2_member" + # @return [Device Array] : Return array of Device objects, which are mounted(permanent or temporary) in the HDA. # Render the first step of the Disk-Wizard(DW) def select_device @@ -58,6 +60,11 @@ def manage_disk if partition.match(/^\/dev/).blank? device = Device.find_with_unallocated(user_selections['disk']) @selected_partiton = (device.partitions.select{|part| part.identifier == user_selections['path'] }).first + else + @selected_partiton = Device.find partition + end + if @selected_partiton.fstype.eql?(LVM_FSTYPE) + flash[:error] = %Q[We do not recommend LVM partitions at Amahi and here is why.] end end