From 7e3aafc03785e709c361f278e75f280debafbe14 Mon Sep 17 00:00:00 2001 From: "mdehaan@mdehaan.rdu.redhat.com" <> Date: Wed, 20 Dec 2006 12:23:53 -0500 Subject: Keep repo representation as strings. Also, add trailing / to rsync URL's to always to prevent user mistakes, which allows us to know where the repomd data files are. --- TODO | 1 + cobbler/action_reposync.py | 3 ++- cobbler/action_sync.py | 6 ++---- cobbler/cobbler_msg.py | 9 +++++++-- cobbler/item_profile.py | 4 ++-- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/TODO b/TODO index 458f45d..45beefe 100644 --- a/TODO +++ b/TODO @@ -8,6 +8,7 @@ always: more new thoughts: 1 - support repo add taking http:// urls, which will use repotrack/reposync 3 - possibly look at pungi, though maybe not if above (^) works well. +1 - make enchant work for remote xen installs core: 1 - turn on locking in production (or think about it) -- important for rsync especially. diff --git a/cobbler/action_reposync.py b/cobbler/action_reposync.py index 96d35f3..2aeffd1 100644 --- a/cobbler/action_reposync.py +++ b/cobbler/action_reposync.py @@ -69,11 +69,12 @@ class RepoSync: if not repo.keep_updated: print "- %s is set to not be updated" return True - print "imagine an rsync happened here, and that it was amazing..." dest_path = os.path.join(self.settings.webdir, "repo_mirror", repo.name) spacer = "" if repo.mirror.find("rsync://") != -1: spacer = "-e ssh" + if not repo.mirror.endswith("/"): + repo.mirror = "%s/" % repo.mirror cmd = "rsync -av %s --delete --delete-excluded --exclude-from=/etc/cobbler/rsync.exclude %s %s" % (spacer, repo.mirror, dest_path) print "executing: %s" % cmd rc = sub_process.call(cmd, shell=True) diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py index 52d9dee..b560ab9 100644 --- a/cobbler/action_sync.py +++ b/cobbler/action_sync.py @@ -295,8 +295,7 @@ class BootSync: # will replace "TEMPLATE::yum_repo_stanza" in a cobbler kickstart file. buf = "" repos = profile.repos - if type(repos) == str: - repos = repos.split(" ") + repos = repos.split(" ") for r in repos: repo = self.repos.find(r) if repo is None: @@ -308,8 +307,7 @@ class BootSync: def generate_config_stanza(self, profile): # returns the line in post that would configure yum to use repos added with "cobbler repo add" repos = profile.repos - if type(repos) == str: - repos = repos.split(" ") + repos = repos.split(" ") buf = "" for r in repos: repo = self.repos.find(r) diff --git a/cobbler/cobbler_msg.py b/cobbler/cobbler_msg.py index 10d16a1..e14a3e8 100644 --- a/cobbler/cobbler_msg.py +++ b/cobbler/cobbler_msg.py @@ -24,7 +24,7 @@ cobbler check cobbler distro add --name= --kernel= --initrd= [--kopts=] [--ksmeta=] [--arch=] -cobbler profile add --name= +cobbler profile add --name= --distro= [--kick-start=] [--kopts=] [--ksmeta=] [--virt-name=] [--virt-file-size=] [--virt-ram=] @@ -33,9 +33,14 @@ cobbler system add --name= --profile= [--pxe-address=] [--ksmeta=] -cobbler import --mirror=rsync://
--mirror-name= +cobbler import --name= --mirror=rsync://
+cobbler import --name= --mirror=user@address:/path cobbler import --path= +cobbler repo add --name= --mirror=rsync://
[--local-file=name] +cobbler repo add --name= --mirror=user@address:/path [--local-file=name] +cobbler reposync + cobbler [distro|profile|system] remove --name= cobbler list diff --git a/cobbler/item_profile.py b/cobbler/item_profile.py index 038c84b..a406c2e 100644 --- a/cobbler/item_profile.py +++ b/cobbler/item_profile.py @@ -39,7 +39,7 @@ class Profile(item.Item): self.virt_file_size = 5 # GB. 5 = Decent _minimum_ default for FC5. self.virt_ram = 512 # MB. Install with 256 not likely to pass self.virt_paravirt = True # hvm support is *NOT* in Koan (now) - self.repos = [] # names of cobbler repo definitions + self.repos = "" # names of cobbler repo definitions def from_datastruct(self,seed_data): """ @@ -80,7 +80,7 @@ class Profile(item.Item): ok = False break if ok: - self.repos = repolist + self.repos = repos else: raise cexceptions.CobblerException("no_repos") -- cgit