Bug #4896
xpath.rb can't print XPath-specified attributes
Status: | Closed | Start date: | 11/04/2016 | |
---|---|---|---|---|
Priority: | Low | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | Core & System | |||
Target version: | Release 5.4 | |||
Resolution: | fixed | Pull request: | ||
Affected Versions: | OpenNebula 4.12, OpenNebula 4.14, OpenNebula 5.0, OpenNebula 5.2 |
Description
Attempting to use "xpath.rb" to print attributes (as opposed to body text) fails.
Patch attached.
Example:
$ virsh --connect qemu:///system dumpxml one-0 2>/dev/null | /var/tmp/one/datastore/xpath.rb '/domain/devices/disk[1]/source/@protocol' /var/tmp/one/datastore/xpath.rb:67:in `block in <main>': undefined method `text' for protocol='rbd':REXML::Attribute (NoMethodError) from /var/tmp/one/datastore/xpath.rb:60:in `each' from /var/tmp/one/datastore/xpath.rb:60:in `<main>' $
Fixed:
$ virsh --connect qemu:///system dumpxml one-0 2>/dev/null | /var/tmp/one/datastore/xpath.rb '/domain/devices/disk[1]/source/@protocol' rbd $
Associated revisions
B #4896: xpath.rb can't print XPath-specified attributes
Signed-off-by: Ruben S. Montero <rsmontero@opennebula.org>
History
#1 Updated by Ruben S. Montero over 4 years ago
- Category set to Core & System
- Status changed from Pending to Closed
- Target version set to Release 5.4
- Resolution set to fixed