From f16cfb70118f67f6e81d07bef695b15912d466a8 Mon Sep 17 00:00:00 2001 From: kyg516 Date: Wed, 14 Sep 2016 11:52:04 +0900 Subject: [PATCH] Update volume controller: add 'sudo' and delete 'Arbiter' option --- app/controllers/volume_controller.rb | 8 ++++---- app/views/volume/index.html.erb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/volume_controller.rb b/app/controllers/volume_controller.rb index edfdcdc..e520764 100644 --- a/app/controllers/volume_controller.rb +++ b/app/controllers/volume_controller.rb @@ -60,7 +60,7 @@ class VolumeController < ApplicationController mount_point = params[:mount_point] # make command string 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 `#{command}` redirect_to '/volume/index' @@ -71,7 +71,7 @@ class VolumeController < ApplicationController volume_name = params[:volume_name] # make command string command = String.new - command << "umount " + @config["host_ip"].to_s + ":/" + volume_name + command << "sudo umount " + @config["host_ip"].to_s + ":/" + volume_name puts command `#{command}` redirect_to '/volume/index' @@ -92,7 +92,7 @@ class VolumeController < ApplicationController end command << @config["host_user"].to_s + "@" + @config["host_ip"].to_s command << " gluster volume create " + volume_name + " " - if !volume_type.equal? "Distribute" + if !volume_type.include? "Distribute" command << volume_type.downcase + " " + num_of_brick + " " end bricks.each do |t| @@ -101,7 +101,7 @@ class VolumeController < ApplicationController command << "force" puts command `#{command}` - redirect_to '/volume/index' + # redirect_to '/volume/index' end def volume_stop diff --git a/app/views/volume/index.html.erb b/app/views/volume/index.html.erb index 87be662..c3d336f 100644 --- a/app/views/volume/index.html.erb +++ b/app/views/volume/index.html.erb @@ -19,7 +19,7 @@