Merge branch 'one-3.6' of git.opennebula.org:one into one-3.6

This commit is contained in:
Tino Vazquez committed 2012-07-03 18:42:19 +02:00
commit 0e91e9e3bf
2 files changed
+15 -2

No files matched your search

+4
View File
@@ -26,6 +26,10 @@ class UserOCCI < User
<ID><%= self.id.to_s %></ID>
<NAME><%= self.name %></NAME>
<GROUP><%= self['GNAME'] %></GROUP>
<%= self.element_xml('DATASTORE_QUOTA') %>
<%= self.element_xml('NETWORK_QUOTA') %>
<%= self.element_xml('VM_QUOTA') %>
<%= self.element_xml('IMAGE_QUOTA') %>
</USER>
}
+11 -2
View File
@@ -261,6 +261,15 @@ module OpenNebula
end
end
# Returns the xml of an element
def element_xml(xpath)
if NOKOGIRI
@xml.xpath(xpath).to_s
else
@xml.elements[xpath].to_s
end
end
# Returns elements in text form
# root_element:: _String_ base element
# indent:: _Boolean_ indents the resulting string, default true
@@ -368,14 +377,14 @@ module OpenNebula
end
private
#
#
#
def attr_to_str(attr)
attr.gsub!('"',"\\\"")
attr = "\"#{attr}\""
return attr
end
end