This commit is contained in:
bee0005
2016-08-31 14:42:14 +00:00
parent 87a6b90eda
commit 7ff5f4ece2
3 changed files with 34 additions and 21 deletions

View File

@@ -93,25 +93,29 @@ class VolumeController < ApplicationController
render :json => {:file => files , :current => @current_dir}
end
def mount
def volume_mount
conf_list = get_conf
host_ip = String.new
conf_list.each do |t|
if t.include? "host_ip="
host_ip = t.split("host_ip=")[1]
end
end
volume_name = params[:volume_name]
volume_name = volume_name.delete(' ')
puts "mount -t glusterfs " + host_ip + ":/" + volume_name + " /mnt/glusterfs"
conf_list.each do |t|
if t.include? "host_ip="
host_ip = t.split("host_ip=")[1]
end
end
volume_name = params[:volume_name]
volume_name = volume_name.delete(' ')
puts "mount -t glusterfs " + host_ip + ":/" + volume_name + " /mnt/glusterfs"
redirect_to '/volume/index'
end
def volume_stop
puts "gluster volume stop volume_name"
volume_name = params[:volume_name]
volume_name = volume_name.delete(' ')
puts "gluster volume stop " + volume_name
end
def volume_start
puts "gluster volume start volume_name"
volume_name = params[:volume_name]
volume_name = volume_name.delete(' ')
puts "gluster volume start " + volume_name
end
end