mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
Fix bug introduced in to_xml methods
This commit is contained in:
parent
b88965051a
commit
a473b28052
@ -324,7 +324,8 @@ error_common:
|
||||
|
||||
string& Image::to_xml(string& xml) const
|
||||
{
|
||||
string aux_str;
|
||||
string template_xml;
|
||||
string perms_xml;
|
||||
ostringstream oss;
|
||||
|
||||
oss <<
|
||||
@ -335,7 +336,7 @@ string& Image::to_xml(string& xml) const
|
||||
"<UNAME>" << uname << "</UNAME>" <<
|
||||
"<GNAME>" << gname << "</GNAME>" <<
|
||||
"<NAME>" << name << "</NAME>" <<
|
||||
perms_to_xml(aux_str) <<
|
||||
perms_to_xml(perms_xml) <<
|
||||
"<TYPE>" << type << "</TYPE>" <<
|
||||
"<PUBLIC>" << public_obj << "</PUBLIC>" <<
|
||||
"<PERSISTENT>" << persistent_img << "</PERSISTENT>" <<
|
||||
@ -346,7 +347,7 @@ string& Image::to_xml(string& xml) const
|
||||
"<SIZE>" << size_mb << "</SIZE>" <<
|
||||
"<STATE>" << state << "</STATE>" <<
|
||||
"<RUNNING_VMS>" << running_vms << "</RUNNING_VMS>" <<
|
||||
obj_template->to_xml(aux_str) <<
|
||||
obj_template->to_xml(template_xml) <<
|
||||
"</IMAGE>";
|
||||
|
||||
xml = oss.str();
|
||||
|
@ -1237,7 +1237,9 @@ string& VirtualMachine::to_xml_extended(string& xml) const
|
||||
|
||||
string& VirtualMachine::to_xml_extended(string& xml, bool extended) const
|
||||
{
|
||||
string aux_str;
|
||||
string template_xml;
|
||||
string history_xml;
|
||||
string perm_xml;
|
||||
ostringstream oss;
|
||||
|
||||
oss << "<VM>"
|
||||
@ -1247,7 +1249,7 @@ string& VirtualMachine::to_xml_extended(string& xml, bool extended) const
|
||||
<< "<UNAME>" << uname << "</UNAME>"
|
||||
<< "<GNAME>" << gname << "</GNAME>"
|
||||
<< "<NAME>" << name << "</NAME>"
|
||||
<< perms_to_xml(aux_str)
|
||||
<< perms_to_xml(perm_xml)
|
||||
<< "<LAST_POLL>" << last_poll << "</LAST_POLL>"
|
||||
<< "<STATE>" << state << "</STATE>"
|
||||
<< "<LCM_STATE>" << lcm_state << "</LCM_STATE>"
|
||||
@ -1258,7 +1260,7 @@ string& VirtualMachine::to_xml_extended(string& xml, bool extended) const
|
||||
<< "<CPU>" << cpu << "</CPU>"
|
||||
<< "<NET_TX>" << net_tx << "</NET_TX>"
|
||||
<< "<NET_RX>" << net_rx << "</NET_RX>"
|
||||
<< obj_template->to_xml(aux_str);
|
||||
<< obj_template->to_xml(template_xml);
|
||||
|
||||
if ( hasHistory() )
|
||||
{
|
||||
@ -1268,12 +1270,12 @@ string& VirtualMachine::to_xml_extended(string& xml, bool extended) const
|
||||
{
|
||||
for (unsigned int i=0; i < history_records.size(); i++)
|
||||
{
|
||||
oss << history_records[i]->to_xml(aux_str);
|
||||
oss << history_records[i]->to_xml(history_xml);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
oss << history->to_xml(aux_str);
|
||||
oss << history->to_xml(history_xml);
|
||||
}
|
||||
|
||||
oss << "</HISTORY_RECORDS>";
|
||||
|
@ -206,7 +206,8 @@ error_common:
|
||||
string& VMTemplate::to_xml(string& xml) const
|
||||
{
|
||||
ostringstream oss;
|
||||
string aux_str;
|
||||
string template_xml;
|
||||
string perm_str;
|
||||
|
||||
oss << "<VMTEMPLATE>"
|
||||
<< "<ID>" << oid << "</ID>"
|
||||
@ -215,10 +216,10 @@ string& VMTemplate::to_xml(string& xml) const
|
||||
<< "<UNAME>" << uname << "</UNAME>"
|
||||
<< "<GNAME>" << gname << "</GNAME>"
|
||||
<< "<NAME>" << name << "</NAME>"
|
||||
<< perms_to_xml(aux_str)
|
||||
<< perms_to_xml(perm_str)
|
||||
<< "<PUBLIC>" << public_obj << "</PUBLIC>"
|
||||
<< "<REGTIME>" << regtime << "</REGTIME>"
|
||||
<< obj_template->to_xml(aux_str)
|
||||
<< obj_template->to_xml(template_xml)
|
||||
<< "</VMTEMPLATE>";
|
||||
|
||||
xml = oss.str();
|
||||
|
@ -464,7 +464,10 @@ string& VirtualNetwork::to_xml_extended(string& xml) const
|
||||
string& VirtualNetwork::to_xml_extended(string& xml, bool extended) const
|
||||
{
|
||||
ostringstream os;
|
||||
string aux_str;
|
||||
|
||||
string template_xml;
|
||||
string leases_xml;
|
||||
string perm_str;
|
||||
|
||||
// Total leases is the number of used leases.
|
||||
int total_leases = 0;
|
||||
@ -482,7 +485,7 @@ string& VirtualNetwork::to_xml_extended(string& xml, bool extended) const
|
||||
"<UNAME>" << uname << "</UNAME>" <<
|
||||
"<GNAME>" << gname << "</GNAME>" <<
|
||||
"<NAME>" << name << "</NAME>" <<
|
||||
perms_to_xml(aux_str) <<
|
||||
perms_to_xml(perm_str) <<
|
||||
"<TYPE>" << type << "</TYPE>" <<
|
||||
"<BRIDGE>" << bridge << "</BRIDGE>"<<
|
||||
"<VLAN>" << vlan << "</VLAN>";
|
||||
@ -522,14 +525,14 @@ string& VirtualNetwork::to_xml_extended(string& xml, bool extended) const
|
||||
|
||||
os << "<PUBLIC>" << public_obj << "</PUBLIC>" <<
|
||||
"<TOTAL_LEASES>"<< total_leases << "</TOTAL_LEASES>"<<
|
||||
obj_template->to_xml(aux_str);
|
||||
obj_template->to_xml(template_xml);
|
||||
|
||||
if (extended)
|
||||
{
|
||||
if (leases != 0)
|
||||
{
|
||||
os << "<LEASES>" <<
|
||||
leases->to_xml(aux_str) <<
|
||||
leases->to_xml(leases_xml) <<
|
||||
"</LEASES>";
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user