summaryrefslogtreecommitdiffstats
path: root/cobbler/utils.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-04-20 17:57:02 -0400
committerMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-04-20 17:57:02 -0400
commitbb1e5b50e930b7c9618387cc43634e6050eb3481 (patch)
treeac7feb459190458ed21a57ae1bf7d5dc5b664666 /cobbler/utils.py
parent8205bf0691bb48080c3bc4d0fd7c444238187801 (diff)
downloadthird_party-cobbler-bb1e5b50e930b7c9618387cc43634e6050eb3481.tar.gz
third_party-cobbler-bb1e5b50e930b7c9618387cc43634e6050eb3481.tar.xz
third_party-cobbler-bb1e5b50e930b7c9618387cc43634e6050eb3481.zip
This commit overhauls the main cobbler CLI module and adds support for
object renaming, copying, and editing -- previously only addition and removal were supported. This frees uses (hopefully) from the need to hack YAML and risk damaging their configurations by rendering the config unparseable. It also makes "cobbler list" print out a simple tree representation that shows the association between objects. This also relaxes the requirements for what constitutes a kernel and initrd filename, just in case they are named something different. They still have to exist.
Diffstat (limited to 'cobbler/utils.py')
-rw-r--r--cobbler/utils.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/cobbler/utils.py b/cobbler/utils.py
index e7bd3fa..e658583 100644
--- a/cobbler/utils.py
+++ b/cobbler/utils.py
@@ -136,11 +136,12 @@ def find_kernel(path):
if path is None:
return None
if os.path.isfile(path):
- filename = os.path.basename(path)
- if _re_kernel.match(filename):
- return path
- elif filename == "vmlinuz":
- return path
+ #filename = os.path.basename(path)
+ #if _re_kernel.match(filename):
+ # return path
+ #elif filename == "vmlinuz":
+ # return path
+ return path
elif os.path.isdir(path):
return find_highest_files(path,"vmlinuz",_re_kernel)
return None
@@ -171,11 +172,12 @@ def find_initrd(path):
if path is None:
return None
if os.path.isfile(path):
- filename = os.path.basename(path)
- if _re_initrd.match(filename):
- return path
- if filename == "initrd.img" or filename == "initrd":
- return path
+ #filename = os.path.basename(path)
+ #if _re_initrd.match(filename):
+ # return path
+ #if filename == "initrd.img" or filename == "initrd":
+ # return path
+ return path
elif os.path.isdir(path):
return find_highest_files(path,"initrd.img",_re_initrd)
return None