Skip to content

Commit

Permalink
hound: Fix some hound complains
Browse files Browse the repository at this point in the history
  • Loading branch information
Rick Salevsky committed Jan 9, 2017
1 parent 6fb5fad commit ac83623
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions crowbar_framework/app/controllers/nodes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def index
@groups = {}
session[:node] = params[:name]
if params.key?(:role)
result = Node.all #this is not efficient, please update w/ a search!
result = Node.all # this is not efficient, please update w/ a search!
@nodes = result.find_all { |node| node.role? params[:role] }
if params.key?(:names_only)
names = @nodes.map { |node| node.handle }
Expand Down Expand Up @@ -598,27 +598,27 @@ def get_nodes_and_groups(node_name, draggable = true)
@sum = 0
@groups = {}
@nodes = {}
raw_nodes = Node.all
raw_nodes.each do |node|
@sum = @sum + node.name.hash
@nodes[node.handle] = { alias: node.alias, description: node.description, status: node.status, state: node.state }
group = node.group
@groups[group] = { automatic: !node.display_set?("group"),
status: { "ready" => 0,
"failed" => 0,
"unknown" => 0,
"unready" => 0,
"pending" => 0,
"crowbar_upgrade" => 0 },
nodes: {}
} unless @groups.key? group
@groups[group][:nodes][node.group_order] = node.handle
@groups[group][:status][node.status] = (@groups[group][:status][node.status] || 0).to_i + 1
if node.handle === node_name
@node = node
get_node_and_network(node.handle)
end
raw_nodes = Node.all
raw_nodes.each do |node|
@sum = @sum + node.name.hash
@nodes[node.handle] = { alias: node.alias, description: node.description, status: node.status, state: node.state }
group = node.group
@groups[group] = { automatic: !node.display_set?("group"),
status: { "ready" => 0,
"failed" => 0,
"unknown" => 0,
"unready" => 0,
"pending" => 0,
"crowbar_upgrade" => 0 },
nodes: {}
} unless @groups.key? group
@groups[group][:nodes][node.group_order] = node.handle
@groups[group][:status][node.status] = (@groups[group][:status][node.status] || 0).to_i + 1
if node.handle === node_name
@node = node
get_node_and_network(node.handle)
end
end
@draggable = draggable
end
end

0 comments on commit ac83623

Please sign in to comment.