Skip to content

Commit

Permalink
web UI: fix master/slave resource status from old pcsd
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmular committed Sep 21, 2015
1 parent 0bc5b3c commit a4cdb62
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pcsd/cluster_entity.rb
Expand Up @@ -191,6 +191,7 @@ def self.make_resources_tree(primitives)
mi = ClusterEntity::Clone.new
else
mi = ClusterEntity::MasterSlave.new
mi.masters_unknown = true
end
mi.id = mi_id
mi.meta_attr = ClusterEntity::get_meta_attr_from_status_v1(
Expand Down Expand Up @@ -854,10 +855,11 @@ def to_status(version='1')


class MasterSlave < MultiInstance
attr_accessor :masters, :slaves
attr_accessor :masters, :slaves, :masters_unknown

def initialize(master_cib_element=nil, crm_dom=nil, rsc_status=nil, parent=nil, operations=nil)
super(master_cib_element, crm_dom, rsc_status, parent, operations)
@masters_unknown = false
@class_type = 'master'
@masters = []
@slaves = []
Expand All @@ -869,7 +871,7 @@ def initialize(master_cib_element=nil, crm_dom=nil, rsc_status=nil, parent=nil,
primitive_list = @member.members
end
@masters, @slaves = get_masters_slaves(primitive_list)
if (@masters.empty? and
if (@masters.empty? and !@masters_unknown and
@status != ClusterEntity::ResourceStatus.new(:disabled)
)
@warning_list << {
Expand Down Expand Up @@ -913,7 +915,7 @@ def update_status
primitive_list = @member.members
end
@masters, @slaves = get_masters_slaves(primitive_list)
if (@masters.empty? and
if (@masters.empty? and !@masters_unknown and
@member.status == ClusterEntity::ResourceStatus.new(:running)
)
@status = ClusterEntity::ResourceStatus.new(:partially_running)
Expand Down

0 comments on commit a4cdb62

Please sign in to comment.