Add error handling to top tiles

This commit is contained in:
kyg516
2016-09-26 17:10:11 +09:00
parent b10c6803ac
commit fada76fde7
2 changed files with 26 additions and 10 deletions

View File

@@ -27,6 +27,12 @@ module ApplicationHelper
volume = Hash.new
node = Node.take
df = get_df
# error check : node is nil
if node.nil?
return volumes
end
command = String.new
command << "sshpass -p#{node.user_password} ssh #{node.user_name}@#{node.host_ip} gluster volume info"
puts command