Merge branch 'master' of https://github.com/oss2016summer/gluster-web-interface
This commit is contained in:
20
app/controllers/peer_controller.rb
Normal file
20
app/controllers/peer_controller.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
class PeerController < ApplicationController
|
||||
def index
|
||||
@hosts = Array.new
|
||||
|
||||
if get_hosts.blank?
|
||||
flash[:danger] = "Check Server"
|
||||
else
|
||||
@hosts = get_hosts
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
def get_hosts
|
||||
file_str = `cat ` + @hostfile_path
|
||||
hosts_str = file_str.split("hosts:")[1]
|
||||
return hosts_str.split("\n")
|
||||
end
|
||||
|
||||
@hostfile_path = "../../../configure.conf"
|
||||
end
|
||||
Reference in New Issue
Block a user