lib/ovirt/storage_domain.rb in rbovirt-0.0.9 vs lib/ovirt/storage_domain.rb in rbovirt-0.0.10
- old
+ new
@@ -1,19 +1,20 @@
module OVIRT
class StorageDomain < BaseObject
- attr_reader :available, :used, :kind, :address, :path
+ attr_reader :available, :used, :kind, :address, :path, :role
def initialize(client, xml)
super(client, xml[:id], xml[:href], (xml/'name').first.text)
parse_xml_attributes!(xml)
self
end
private
def parse_xml_attributes!(xml)
- @available = (xml/'available').first.text
- @used = (xml/'used').first.text
+ @available = ((xml/'available').first.text rescue nil)
+ @used = ((xml/'used').first.text rescue nil)
+ @role = (xml/'type').first.text
@kind = (xml/'storage/type').first.text
@address = ((xml/'storage/address').first.text rescue nil)
@path = ((xml/'storage/path').first.text rescue nil)
end
end
\ No newline at end of file