[Pacemaker] reliable way to cib SEGFAULT -- how is cibadmin -Q --xpath supposed to work?

Lars Ellenberg lars.ellenberg at linbit.com
Thu Jun 4 07:33:40 EDT 2009


On Wed, Jun 03, 2009 at 10:45:41PM +0200, Andrew Beekhof wrote:
> fixed:
>    http://hg.clusterlabs.org/pacemaker/stable-1.0/rev/cf478ed1269f

thanks.
though that simply returns the parent XML_ELEMENT_NODE,
which makes both
'//primitive[@type="IPaddr2" and instance_attributes/nvpair[@name = "ip" and @value="10.0.0.1"]]' and
'//primitive[@type="IPaddr2" and instance_attributes/nvpair[@name = "ip" and @value="10.0.0.1"]]/@id'
return the same, namely the full primitive xml:
      <primitive class="ocf" id="ip_try3" provider="heartbeat" type="IPaddr2">
        <instance_attributes id="ip_try3-instance_attributes">
          <nvpair id="ip_try3-instance_attributes-ip" name="ip" value="10.0.0.1"/>
        </instance_attributes>
      </primitive>

where I would have liked the ..../@id to only spit out
	ip_try3

current workaround is obviously
 | sed -ne '1 { s/^<.* id="\([^"]*\)".*>$/\1/p; };q'

but "it would be nice..."
hm. maybe I can hack something there myself.

> > cat > tmp.xml <<___
> > <cib>
> >  <configuration>
> >    <resources>
> >      <primitive class="ocf" id="ip_try3" provider="heartbeat" type="IPaddr2">
> >        <instance_attributes id="ip_try3-instance_attributes">
> >          <nvpair id="ip_try3-instance_attributes-ip" name="ip" value="10.0.0.1"/>
> >        </instance_attributes>
> >      </primitive>
> >    </resources>
> >  </configuration>
> > </cib>
> > ___
> >
> >
> > xmllint --shell tmp.xml <<<'ls //@id'
> > / > ls //@id
> > tan        7 ip_try3
> > t--       27 ip_try3-instance_attributes
> > t--       30 ip_try3-instance_attributes-ip
> > / >
> >
> > xmllint --shell tmp.xml <<<'ls //primitive[@type="IPaddr2" and instance_attributes/nvpair[@name = "ip" and @value="10.0.0.1"]]/@id'
> > / > ls //primitive[@type="IPaddr2" and instance_attributes/nvpair[@name = "ip" and @value="10.0.0.1"]]/@id
> > tan        7 ip_try3
> > / >

-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.




More information about the Pacemaker mailing list