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

bug #2794: Init oneadmin_name in UserPool()

This commit is contained in:
Ruben S. Montero 2014-03-23 21:09:38 +01:00
parent f408428f26
commit 3b4e1a89e4

View File

@ -80,14 +80,23 @@ UserPool::UserPool(SqlDB * db,
_session_expiration_time = __session_expiration_time;
//Federation slaves do not need to init the pool
User * oneadmin_user = get(0, true);
//Slaves do not need to init the pool, just the oneadmin username
if (is_federation_slave)
{
if (oneadmin_user == 0)
{
throw("Database has not been bootstrapped with master data.");
}
oneadmin_name = oneadmin_user->get_name();
oneadmin_user->unlock();
return;
}
User * oneadmin_user = get(0, true);
if (oneadmin_user != 0)
{
oneadmin_name = oneadmin_user->get_name();