Update volume controller: add 'sudo' and delete 'Arbiter' option
This commit is contained in:
parent
c1a44853af
commit
f16cfb7011
@ -60,7 +60,7 @@ class VolumeController < ApplicationController
|
|||||||
mount_point = params[:mount_point]
|
mount_point = params[:mount_point]
|
||||||
# make command string
|
# make command string
|
||||||
command = String.new
|
command = String.new
|
||||||
command << "mount -t glusterfs " + @config["host_ip"].to_s + ":/" + volume_name + " " + mount_point
|
command << "sudo mount -t glusterfs " + @config["host_ip"].to_s + ":/" + volume_name + " " + mount_point
|
||||||
puts command
|
puts command
|
||||||
`#{command}`
|
`#{command}`
|
||||||
redirect_to '/volume/index'
|
redirect_to '/volume/index'
|
||||||
@ -71,7 +71,7 @@ class VolumeController < ApplicationController
|
|||||||
volume_name = params[:volume_name]
|
volume_name = params[:volume_name]
|
||||||
# make command string
|
# make command string
|
||||||
command = String.new
|
command = String.new
|
||||||
command << "umount " + @config["host_ip"].to_s + ":/" + volume_name
|
command << "sudo umount " + @config["host_ip"].to_s + ":/" + volume_name
|
||||||
puts command
|
puts command
|
||||||
`#{command}`
|
`#{command}`
|
||||||
redirect_to '/volume/index'
|
redirect_to '/volume/index'
|
||||||
@ -92,7 +92,7 @@ class VolumeController < ApplicationController
|
|||||||
end
|
end
|
||||||
command << @config["host_user"].to_s + "@" + @config["host_ip"].to_s
|
command << @config["host_user"].to_s + "@" + @config["host_ip"].to_s
|
||||||
command << " gluster volume create " + volume_name + " "
|
command << " gluster volume create " + volume_name + " "
|
||||||
if !volume_type.equal? "Distribute"
|
if !volume_type.include? "Distribute"
|
||||||
command << volume_type.downcase + " " + num_of_brick + " "
|
command << volume_type.downcase + " " + num_of_brick + " "
|
||||||
end
|
end
|
||||||
bricks.each do |t|
|
bricks.each do |t|
|
||||||
@ -101,7 +101,7 @@ class VolumeController < ApplicationController
|
|||||||
command << "force"
|
command << "force"
|
||||||
puts command
|
puts command
|
||||||
`#{command}`
|
`#{command}`
|
||||||
redirect_to '/volume/index'
|
# redirect_to '/volume/index'
|
||||||
end
|
end
|
||||||
|
|
||||||
def volume_stop
|
def volume_stop
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
</label>
|
</label>
|
||||||
<div class="col-md-9 col-sm-9 col-xs-12">
|
<div class="col-md-9 col-sm-9 col-xs-12">
|
||||||
<select class="form-control">
|
<select class="form-control">
|
||||||
<% ['Distribute', 'Stripe', 'Replica', 'Arbiter', 'Disperse', 'Disperse-data', 'Redundancy'].each do |types|%>
|
<% ['Distribute', 'Stripe', 'Replica', 'Disperse', 'Disperse-data', 'Redundancy'].each do |types|%>
|
||||||
<option><%=types%></option>
|
<option><%=types%></option>
|
||||||
<% end %>
|
<% end %>
|
||||||
</select>
|
</select>
|
||||||
|
Loading…
Reference in New Issue
Block a user