mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
feature #2693: Do not register hooks in federation slaves
This commit is contained in:
parent
c3f1eca676
commit
953f11d699
@ -69,7 +69,15 @@ AclManager::AclManager(
|
||||
|
||||
unset_callback();
|
||||
|
||||
if (!is_federation_slave && lastOID == -1)
|
||||
am.addListener(this);
|
||||
|
||||
//Federation slaves do not need to init the pool
|
||||
if (is_federation_slave)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (lastOID == -1)
|
||||
{
|
||||
// Add a default rules for the ACL engine
|
||||
string error_str;
|
||||
@ -103,10 +111,7 @@ AclManager::AclManager(
|
||||
AuthRequest::CREATE,
|
||||
AclRule::ALL_ID,
|
||||
error_str);
|
||||
|
||||
}
|
||||
|
||||
am.addListener(this);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
@ -46,8 +46,14 @@ GroupPool::GroupPool(SqlDB * db,
|
||||
ostringstream oss;
|
||||
string error_str;
|
||||
|
||||
//Federation slaves do not need to init the pool
|
||||
if (is_federation_slave)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//lastOID is set in PoolSQL::init_cb
|
||||
if (!is_federation_slave && get_lastOID() == -1)
|
||||
if (get_lastOID() == -1)
|
||||
{
|
||||
int rc;
|
||||
Group * group;
|
||||
|
@ -80,6 +80,12 @@ UserPool::UserPool(SqlDB * db,
|
||||
|
||||
_session_expiration_time = __session_expiration_time;
|
||||
|
||||
//Federation slaves do not need to init the pool
|
||||
if (is_federation_slave)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
User * oneadmin_user = get(0, true);
|
||||
|
||||
if (oneadmin_user != 0)
|
||||
@ -92,11 +98,6 @@ UserPool::UserPool(SqlDB * db,
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_federation_slave)
|
||||
{
|
||||
goto error_federation;
|
||||
}
|
||||
|
||||
// User oneadmin needs to be added in the bootstrap
|
||||
one_auth = getenv("ONE_AUTH");
|
||||
|
||||
@ -206,10 +207,6 @@ UserPool::UserPool(SqlDB * db,
|
||||
|
||||
return;
|
||||
|
||||
error_federation:
|
||||
oss << "Error reading the oneadmin user from the replicated table: " << error_str;
|
||||
goto error_common;
|
||||
|
||||
error_no_file:
|
||||
oss << "Could not get one_auth file location";
|
||||
goto error_common;
|
||||
|
@ -29,8 +29,14 @@ ZonePool::ZonePool(SqlDB * db, bool is_federation_slave)
|
||||
{
|
||||
string error_str;
|
||||
|
||||
//Federation slaves do not need to init the pool
|
||||
if (is_federation_slave)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//lastOID is set in PoolSQL::init_cb
|
||||
if (!is_federation_slave && get_lastOID() == -1)
|
||||
if (get_lastOID() == -1)
|
||||
{
|
||||
int rc;
|
||||
Template * tmpl;
|
||||
|
Loading…
x
Reference in New Issue
Block a user