summaryrefslogtreecommitdiffstats
path: root/cobbler/utils.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2007-02-01 17:40:04 -0500
committerJim Meyering <jim@meyering.net>2007-02-01 17:40:04 -0500
commit4ce23db0492822de6ba8e8c445e202b72d805028 (patch)
treec45ab9340ffab259fb9a5b7a2893a1ce242a33e2 /cobbler/utils.py
parent7d280f93f627834c4361c8d3958edaed3d589e25 (diff)
downloadthird_party-cobbler-4ce23db0492822de6ba8e8c445e202b72d805028.tar.gz
third_party-cobbler-4ce23db0492822de6ba8e8c445e202b72d805028.tar.xz
third_party-cobbler-4ce23db0492822de6ba8e8c445e202b72d805028.zip
Work towards implementation of optional integrated "light" sync support, which is enabled by default in /var/lib/cobbler/settings.
Users of the API will need to use the with_copy=True and with_delete=True parameters to initiate this behavior. As mentioned in the previous commit, sync() still needs to be run at least once prior to any add commands using this feature.
Diffstat (limited to 'cobbler/utils.py')
-rw-r--r--cobbler/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cobbler/utils.py b/cobbler/utils.py
index 84b8686..4333393 100644
--- a/cobbler/utils.py
+++ b/cobbler/utils.py
@@ -125,6 +125,8 @@ def find_kernel(path):
Given a directory or a filename, find if the path can be made
to resolve into a kernel, and return that full path if possible.
"""
+ if path is None:
+ return None
if os.path.isfile(path):
filename = os.path.basename(path)
if _re_kernel.match(filename):
@@ -142,6 +144,8 @@ def find_initrd(path):
to resolve into an intird, return that full path if possible.
"""
# FUTURE: try to match kernel/initrd pairs?
+ if path is None:
+ return None
if os.path.isfile(path):
filename = os.path.basename(path)
if _re_initrd.match(filename):