summaryrefslogtreecommitdiffstats
path: root/cobbler
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2006-10-16 16:55:48 -0400
committerJim Meyering <jim@meyering.net>2006-10-16 16:55:48 -0400
commit0572c1c1bdb716d91fdaa305d14e70fe0a8fda06 (patch)
tree2ddc2d212cb76a5eb9b8bdf657020a4ff58c2cff /cobbler
parentc3d68090295a776f1cc13ba1f5718a526adec6dc (diff)
downloadthird_party-cobbler-0572c1c1bdb716d91fdaa305d14e70fe0a8fda06.tar.gz
third_party-cobbler-0572c1c1bdb716d91fdaa305d14e70fe0a8fda06.tar.xz
third_party-cobbler-0572c1c1bdb716d91fdaa305d14e70fe0a8fda06.zip
More fixes related to rsync:// import
Diffstat (limited to 'cobbler')
-rw-r--r--cobbler/action_import.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/cobbler/action_import.py b/cobbler/action_import.py
index 5f1f61d..d0b65db 100644
--- a/cobbler/action_import.py
+++ b/cobbler/action_import.py
@@ -76,10 +76,11 @@ class Importer:
try:
os.mkdir(self.path)
except:
- raise cexceptions.CobblerException("couldn't create: %s" % (self.path))
+ if not os.path.exists(self.path):
+ raise cexceptions.CobblerException("couldn't create: %s" % (self.path))
cmd = "rsync -az %s /var/www/cobbler/localmirror/%s --progress" % (self.mirror, self.mirror_name)
sub_process.call(cmd,shell=True)
- update_file = open(os.path.join(self.path,"update.sh"))
+ update_file = open(os.path.join(self.path,"update.sh"),"w+")
update_file.write("#!/bin/sh")
update_file.write("%s\n" % cmd)
# leave this commented out in the file because it will
@@ -92,7 +93,7 @@ class Importer:
self.scrub_orphans()
self.guess_kickstarts()
return True
- return False
+ raise cexceptions.CobblerException("path not specified")
def scrub_orphans(self):
"""