Skip to content

Commit

Permalink
Fix bsc#1163381
Browse files Browse the repository at this point in the history
Hawk2 returns "Low level server error occurred" after authentication if a resource has the same name as a node"
  • Loading branch information
MalloZup committed Jul 30, 2020
1 parent d00b94a commit 19d8a8d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hawk/app/models/cib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ def initialize(id, user, use_file = false, stonithwarning = false)
state = CibTools.op_rc_to_state operation, rc_code, state

# check for guest nodes
if !op.attributes['on_node'].nil? && [:master, :started].include?(state)
if lrm_resource.attributes['container'].nil? && (state == :master || state == :started)
@nodes.select { |n| n[:uname] == rsc_id }.each do |guest|
guest[:host] = node[:uname]
guest[:remote] = true
Expand Down Expand Up @@ -1020,7 +1020,12 @@ def initialize(id, user, use_file = false, stonithwarning = false)
if rsc
rsc_state = rsc[:state]
elsif n[:host]
rsc_state = CibTools.rsc_state_from_lrm_rsc_op(@xml, n[:host], n[:id])
begin
rsc_state = CibTools.rsc_state_from_lrm_rsc_op(@xml, n[:host], n[:id])
rescue NoMethodError => e
# bsc#1163381. Catch the case resource name = node name. this is not allowed in pacemaker
error _("Please check if any resources have IDs that are conflicting with node names" + "#{e.backtrace.first}: #{e.message} (#{e.class})")
end
end
# node has a matching resource:
# get state from resource.rb
Expand Down

0 comments on commit 19d8a8d

Please sign in to comment.