1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

feature #200: Addded username to Image dump

This commit is contained in:
Tino Vázquez 2010-06-22 18:58:17 +02:00
parent e38764e7e2
commit ffd05b42f1
3 changed files with 8 additions and 4 deletions

View File

@ -263,7 +263,7 @@ int Image::dump(ostringstream& oss, int num, char **values, char **names)
(!values[SOURCE]) ||
(!values[STATE]) ||
(!values[RUNNING_VMS]) ||
(num != LIMIT ))
(num != LIMIT + 1))
{
return -1;
}
@ -272,6 +272,7 @@ int Image::dump(ostringstream& oss, int num, char **values, char **names)
"<IMAGE>" <<
"<ID>" << values[OID] << "</ID>" <<
"<UID>" << values[UID] << "</UID>" <<
"<USERNAME>" << values[LIMIT] << "</USERNAME>" <<
"<NAME>" << values[NAME] << "</NAME>" <<
"<TYPE>" << values[TYPE] << "</TYPE>" <<
"<PUBLIC>" << values[PUBLIC] << "</PUBLIC>" <<

View File

@ -260,8 +260,11 @@ int ImagePool::dump(ostringstream& oss, const string& where)
set_callback(static_cast<Callbackable::Callback>(&ImagePool::dump_cb),
static_cast<void *>(&oss));
cmd << "SELECT * FROM " << Image::table;
cmd << "SELECT " << Image::table << ".*, user_pool.user_name FROM "
<< Image::table <<
" LEFT OUTER JOIN (SELECT oid, user_name FROM user_pool) "
<< "AS user_pool ON " << Image::table << ".uid = user_pool.oid";
if ( !where.empty() )
{
cmd << " WHERE " << where;

View File

@ -121,7 +121,7 @@ error_filter_flag:
goto error_common;
error_dump:
oss << "Error getting virtual network pool";
oss << "Error getting image pool";
goto error_common;
error_common: