From d11a2a5b8d5dff793dc51879613029fa5c2c1909 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sat, 23 Sep 2023 23:05:30 +1000 Subject: [PATCH] Update nodelist import to exclude systems managed by us --- app/Jobs/NodelistImport.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/Jobs/NodelistImport.php b/app/Jobs/NodelistImport.php index 0ab07d5..d08b0a0 100644 --- a/app/Jobs/NodelistImport.php +++ b/app/Jobs/NodelistImport.php @@ -444,9 +444,16 @@ class NodelistImport implements ShouldQueue $so->baud = $fields[6]; */ - if ($so->users->count() && $so->getDirty()) { - Log::alert(sprintf('%s:! Refusing to update a system managed by a user',self::LOGKEY),['dirty'=>$so->getDirty()]); - continue; + if ($so->getDirty()) { + if ($so->users->count()) { + Log::alert(sprintf('%s:! Refusing to update a system managed by a user',self::LOGKEY),['dirty'=>$so->getDirty()]); + continue; + } + + if ($so->sessions()->count()) { + Log::alert(sprintf('%s:! Refusing to update a system configured here',self::LOGKEY),['dirty'=>$so->getDirty()]); + continue; + } } // Save the system record