def _trace_resource(self, context, rsc_id, rsc): op_nodes = rsc.node.xpath('.//op') def trace(name): if not any(o for o in op_nodes if o.get('name') == name): if not self._add_trace_op(rsc, name, '0'): context.err("Failed to add trace for %s:%s" % (rsc_id, name)) trace('start') trace('stop') if xmlutil.is_ms(rsc.node): trace('promote') trace('demote') for op_node in op_nodes: rsc.set_op_attr(op_node, constants.trace_ra_attr, "1")
def _trace_resource(self, context, rsc_id, rsc): op_nodes = rsc.node.xpath('.//op') def trace(name): for o in op_nodes: if o.get('name') == name: return if not self._add_trace_op(rsc, name, '0'): context.fatal_error("Failed to add trace for %s:%s" % (rsc_id, name)) trace('start') trace('stop') if xmlutil.is_ms(rsc.node): trace('promote') trace('demote') for op_node in op_nodes: rsc.set_op_attr(op_node, constants.trace_ra_attr, "1")
def is_ms(self): return is_ms(get_topmost_rsc(self.rscdef_node))