File temp_patch_to_avoid_permission_errors.patch of Package cobbler

From 3307e3f0bf1e72e706cafa26ada8b3c5e0ae3b11 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
 <psuarezhernandez@suse.com>
Date: Thu, 31 Mar 2022 16:47:21 +0100
Subject: [PATCH] TEMP: test change to avoid syncing if not cobblerd

---
 cobbler/cobbler_collections/collection.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cobbler/cobbler_collections/collection.py b/cobbler/cobbler_collections/collection.py
index cb1462c5..d17d54ed 100644
--- a/cobbler/cobbler_collections/collection.py
+++ b/cobbler/cobbler_collections/collection.py
@@ -379,7 +379,7 @@ class Collection:
             raise TypeError("API error: storing wrong data type in collection")
 
         # failure of a pre trigger will prevent the object from being added
-        if save and with_triggers:
+        if save and with_triggers and self.api.is_cobblerd:
             utils.run_triggers(self.api, ref, "/var/lib/cobbler/triggers/add/%s/pre/*" % self.collection_type())
 
         self.lock.acquire()
@@ -394,7 +394,7 @@ class Collection:
             self.logger.debug("Added child \"%s\" to parent \"%s\"", ref.name, ref.parent.name)
 
         # perform filesystem operations
-        if save:
+        if save and self.api.is_cobblerd:
             # Save just this item if possible, if not, save the whole collection
             self.collection_mgr.serialize_one_item(ref)
             if ref.parent:
-- 
2.35.1

openSUSE Build Service is sponsored by