mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +00:00
Unbinds pool members when assigning them to the default pool
This commit is contained in:
parent
ea95d3cef2
commit
889bd554d5
1 changed files with 9 additions and 1 deletions
|
|
@ -158,7 +158,15 @@ function pools_rest_utils.bind_member(pools)
|
|||
|
||||
-- Create the instance
|
||||
local s = pools:create()
|
||||
local res, err = s:bind_member_if_not_already_bound(member, pool_id)
|
||||
local res, err
|
||||
|
||||
if pool_id == s.DEFAULT_POOL_ID then
|
||||
-- Always bind the member to the default pool id (possibly removing it from any other pool)
|
||||
res, err = s:bind_member(member, pool_id)
|
||||
else
|
||||
-- Bind the member only if it is not already in another pool
|
||||
res, err = s:bind_member_if_not_already_bound(member, pool_id)
|
||||
end
|
||||
|
||||
if not res then
|
||||
if err == base_pools.ERRORS.ALREADY_BOUND then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue