Skip to content

Commit

Permalink
Show warning message after choosing LVM partition
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedKamal1432 committed Aug 24, 2015
1 parent b926859 commit 70a3cde
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/controllers/disk_wizard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <a href="#" target="_blank">LVM partitions at Amahi and here is why</a>.]
end
end

Expand Down

0 comments on commit 70a3cde

Please sign in to comment.