diff options
author | David Lutterkort <dlutter@redhat.com> | 2006-10-23 14:04:52 -0700 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2006-10-23 14:04:52 -0700 |
commit | 679d35e42dfc3ae181167522dc1f171dcf008a84 (patch) | |
tree | 318c8b48b156e68b5188f65673132e5eef38745c /cobbler/action_import.py | |
parent | 039525e89dc30036bc8998f5b18f5729e0b2b8f9 (diff) | |
parent | 8cdc8d9c48e55846adf9c85f9b9d57c0b2483d72 (diff) | |
download | third_party-cobbler-679d35e42dfc3ae181167522dc1f171dcf008a84.tar.gz third_party-cobbler-679d35e42dfc3ae181167522dc1f171dcf008a84.tar.xz third_party-cobbler-679d35e42dfc3ae181167522dc1f171dcf008a84.zip |
Merge latest
Diffstat (limited to 'cobbler/action_import.py')
-rw-r--r-- | cobbler/action_import.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/cobbler/action_import.py b/cobbler/action_import.py index 486842e..69bfa97 100644 --- a/cobbler/action_import.py +++ b/cobbler/action_import.py @@ -85,19 +85,18 @@ class Importer: if self.path and not os.path.isdir(self.path): raise cexceptions.CobblerException("import_failed","bad path") if self.mirror is not None: + if not self.mirror.startswith("rsync://"): + raise cexceptions.CobblerException("import_failed","expecting rsync:// url") if self.mirror_name is None: raise cexceptions.CobblerException("import_failed","must specify --mirror-name") print "This will take a while..." self.path = "/var/www/cobbler/localmirror/%s" % self.mirror_name try: - os.makedirs(self.path) + os.mkdir(self.path) except: if not os.path.exists(self.path): raise cexceptions.CobblerException("couldn't create: %s" % (self.path)) - spacer = "" - if not self.mirror.startswith("rsync://"): - spacer = ' -e "ssh" ' - cmd = "rsync -az %s %s /var/www/cobbler/localmirror/%s --progress" % (spacer, self.mirror, self.mirror_name) + 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"),"w+") update_file.write("#!/bin/sh") @@ -187,7 +186,7 @@ class Importer: if tentative == filter_out: fnames.remove(tentative) print "%s" % dirname - if not self.is_pxe_or_virt_dir(dirname): + if not self.is_pxe_or_xen_dir(dirname): return for x in fnames: if x.startswith("initrd"): @@ -236,8 +235,8 @@ class Importer: return "x86" return "x86" - def is_pxe_or_virt_dir(self,dirname): - if dirname.find("pxe") != -1 or dirname.find("xen") != -1 or dirname.find("virt") != -1: + def is_pxe_or_xen_dir(self,dirname): + if dirname.find("pxe") != -1 or dirname.find("xen") != -1: return True return False |