mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
MPLS Services (#10421)
* initial database migrations * first part, discovery * second part, polling * add SAP polling and discovery * style checks * rename variables in more generic way * html global pages for sdp and sdp binds * add Services and SAPs * port links, database, etc. * html device routing pages * add tests * checks * rework database id relationship * scruntinizer inspection * fix unit test for new mpls tables
This commit is contained in:
@@ -41,14 +41,14 @@ trait SyncsModels
|
||||
$models = $models->keyBy->getCompositeKey();
|
||||
$existing = $device->$relationship->keyBy->getCompositeKey();
|
||||
|
||||
foreach ($existing as $key => $existing_lsp) {
|
||||
if ($models->offsetExists($key)) {
|
||||
foreach ($existing as $exist_key => $exist_value) {
|
||||
if ($models->offsetExists($exist_key)) {
|
||||
// update
|
||||
$existing_lsp->fill($models->get($key)->getAttributes())->save();
|
||||
$exist_value->fill($models->get($exist_key)->getAttributes())->save();
|
||||
} else {
|
||||
// delete
|
||||
$existing_lsp->delete();
|
||||
$existing->forget($key);
|
||||
$exist_value->delete();
|
||||
$existing->forget($exist_key);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user