[Et-mgmt-commits-list] [SCM] virt-factory branch, master now at v0.0.3-148-gd8fd65b
Michael DeHaan
mdehaan at redhat.com
Wed Aug 8 21:28:10 UTC 2007
Hello,
This is an automated email from the git hooks/update script, it was
generated because a ref change was pushed to the repository.
Updating branch, master,
via d8fd65b459653f1e6aa251275a293ef2c4fce854 (commit)
via 3a7285188c310792783bd92ecb89cde1246658e0 (commit)
via 652623a281cf8a839c54e628674f944e84f76ae9 (commit)
via 3187e01f63e6362e69114250a8f96f643e5c8041 (commit)
via 3e2a758ebfefd10c97b01471c56e8d791768b1db (commit)
via 84c339cbbb3cc38a6bb437979b49c13285d6e323 (commit)
from b4d895fe439856ba81d25d6ab5f4b37d2532ef41 (commit)
- Log -----------------------------------------------------------------
commit d8fd65b459653f1e6aa251275a293ef2c4fce854
Merge: 3a72851... b4d895f...
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Wed Aug 8 17:24:21 2007 -0400
Merge branch 'master' of git+ssh://g-mdehaan@et.redhat.com/git/virt-factory
commit 3a7285188c310792783bd92ecb89cde1246658e0
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Wed Aug 8 17:20:58 2007 -0400
Fencepost.
commit 652623a281cf8a839c54e628674f944e84f76ae9
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Wed Aug 8 17:13:08 2007 -0400
Fix repo names
commit 3187e01f63e6362e69114250a8f96f643e5c8041
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Wed Aug 8 16:57:25 2007 -0400
Adding debug
commit 3e2a758ebfefd10c97b01471c56e8d791768b1db
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Wed Aug 8 16:52:17 2007 -0400
More work on provisioning bits
commit 84c339cbbb3cc38a6bb437979b49c13285d6e323
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Wed Aug 8 15:55:30 2007 -0400
Make distro and repo stuff flexible in terms of supported arches, such that it works
pretty much automatically. Allow for seperate vf_repo based on arch, and include updates
but only for packages we care about. If user wants full mirroring of updates they can
achieve this by making extras_rpms an empty list or doing something on their own with
cobbler and/or config management.
-----------------------------------------------------------------------
Diffstat:
build/settings | 5 ++-
build/test-it-all.sh | 2 +-
service/modules/provisioning.py | 69 +++++++++++++++++++++++++++++---------
service/scripts/vf_import | 2 +-
service/settings | 5 ++-
5 files changed, 62 insertions(+), 21 deletions(-)
diff --git a/build/settings b/build/settings
index 73471c5..051bcfa 100755
--- a/build/settings
+++ b/build/settings
@@ -4,7 +4,10 @@ databases:
logs:
service: /var/log/virt-factory/svclog
repos:
- vf_repo: 'VF_REPO'
+ F-7-i386-vf_repo: 'VF_REPO/repo/fc7/stable/i386/'
+ F-7-x86_64-vf_repo: 'VF_REPO/repo/fc7/stable/x86_64/'
+ F-7-i386-updates-lite: 'http://download.fedora.redhat.com/pub/fedora/linux/updates/7/i386/'
+ F-7-x86_64-updates-lite: 'http://download.fedora.redhat.com/pub/fedora/linux/updates/7/x86_64/'
mirrors:
F-7: [ '/mnt/engarchive2/released/F-7/GOLD/Fedora/', '' ]
this_server:
diff --git a/build/test-it-all.sh b/build/test-it-all.sh
index 199e5ce..6ef9d91 100755
--- a/build/test-it-all.sh
+++ b/build/test-it-all.sh
@@ -244,7 +244,7 @@ setup_vf_server()
# FIXME: this path shouldn't be hardcoded
get_fedora_release
ARCH=`uname -p`
- VF_REPO="http://$REMOTE_HOST/$URL_PATH/repo/f$FEDORA_RELEASE/devel/$ARCH"
+ VF_REPO="http://$REMOTE_HOST/$URL_PATH"
cp settings settings.testing
export HN VF_REPO
perl -p -i -e "s/ADDRESS/\$ENV{'HN'}/g" settings.testing
diff --git a/service/modules/provisioning.py b/service/modules/provisioning.py
index 84ae315..388f74d 100755
--- a/service/modules/provisioning.py
+++ b/service/modules/provisioning.py
@@ -45,6 +45,7 @@ import web_svc
import os
import threading
import traceback
+import urlgrabber
#--------------------------------------------------------------------
@@ -130,9 +131,13 @@ class CobblerTranslatedRepo:
new_item = cobbler_api.new_repo()
new_item.set_name(name)
new_item.set_mirror(url)
- if name.find("extras") != -1:
- # don't pull in all of extras
- new_item.set_rpm_list(vf_config["extras_rpms"])
+ if name.find("-lite") != -1:
+ # don't pull in all content, just the packages we care about
+ # NOTE: is this appropriate for all cases? Not really. So
+ # if the list is blank, pull in everything so people have
+ # a way to turn it off.
+ if len(vf_config["extras_rpms"]) != 0:
+ new_item.set_rpm_list(vf_config["extras_rpms"])
cobbler_api.repos().add(new_item)
#--------------------------------------------------------------------
@@ -197,23 +202,35 @@ class CobblerTranslatedProfile:
new_item.set_kickstart("/var/lib/virt-factory/kick-fc6.ks")
+ # code to only attach a repo if it is actually defined in cobbler. This is so that
+ # repos we don't have arches for don't break our configs -- mostly a test issue
+ # and not a production issue.
+
+ def repos_append(repos, name):
+ if cobbler_api.repos().find(name) is not None:
+ print "- adding repository link: %s" % name
+ repos.append(name)
+ else:
+ print "- repo not linked to profile, since it was not found: %s" % name
+
# the repositories that this profile will use vary by architecture. Let's not
# set these here and if someone wants to add associations in cobbler then they
# can do so.
- # OBSOLETE --left here in case we decide to do this again
- #
- #if distrib.data["architecture"] == "x86":
- # # not supporting update mirroring at this time in development, but can re-enable later.
- # # namely turned off due to time it takes to sync.
- # # repos.append('fc6i386updates')
- # repos.append('fc6i386extras')
- #if distrib.data["architecture"] == "x86_64":
- # # repos.append('fc6x86_64updates')
- # repos.append('fc6x86_64extras')
- #
-
- repos = ['vf_repo']
+ repos = []
+
+ (dname, dver, junk) = distribution_name.split("-",2)
+
+ if dname.find("x86_64") != -1:
+ repos_append(repos,'%s-%s-x86_64-updates-lite' % (dname, dver))
+ repos_append(repos,'%s-%s-x86_64-vf_repo' % (dname,dver))
+ else:
+ repos_append(repos,'%s-%s-i386-updates-lite' % (dname, dver))
+ repos_append(repos,'%s-%s-i386-vf_repo' % (dname, dver))
+
+ # FIXME: eventual support for nonstandard arches might be useful.
+ # if so, edit the above to add support.
+
new_item.set_repos(repos)
if from_db.has_key("kernel_options"):
@@ -553,7 +570,25 @@ class Provisioning(web_svc.AuthWebSvc):
# deal with repositories first... as the profiles might reference them.
for repo_name in vf_config["repos"].keys():
mirror_url = vf_config["repos"][repo_name]
- CobblerTranslatedRepo(cobbler_api,repo_name,mirror_url)
+
+ # if the remote repository does not exist, and we add it, we'll die on
+ # syncing the mirror and end up in lots of ... peril.
+ # therefore let's try to see if the repo exists and be smart and not
+ # add any repos to cobbler that we don't have on our arch.
+
+ # this really comes up only for testing, where we might not have x86 or x86_64
+ # depending on platform, but we'll have it for users on the real vf_repo
+
+ do_import = False
+ try:
+ urlgrabber.urlread(mirror_url)
+ do_import = True
+ except:
+ print "- not importing inaccessible mirror: %s" % mirror_url
+
+ if do_import:
+ CobblerTranslatedRepo(cobbler_api,repo_name,mirror_url)
+
cobbler_api.reposync()
# read the config entry to find out cobbler's mirror locations
diff --git a/service/scripts/vf_import b/service/scripts/vf_import
index 33d92e8..b0aafa1 100755
--- a/service/scripts/vf_import
+++ b/service/scripts/vf_import
@@ -259,7 +259,7 @@ class VirtFactoryImporter:
# die if we couldn't find any distro for the given profile.
if matches == 0:
- print "- no compatible distributions have been imported for this profile: %s" % profile_dict
+ print "- no compatible distributions have been imported for this profile: %s" % profile_dict["name"]
sys.exit(1)
diff --git a/service/settings b/service/settings
index 85a98c2..ad62f75 100755
--- a/service/settings
+++ b/service/settings
@@ -4,7 +4,10 @@ databases:
logs:
service: /var/log/virt-factory/svclog
repos:
- vf_repo: 'http://virt-factory.et.redhat.com/download/repo/fc7/stable/i386/'
+ f7-i386-vf_repo: 'http://virt-factory.et.redhat.com/download/repo/fc7/stable/i386/'
+ f7-x86_64-vf_repo: 'http://virt-factory.et.redhat.com/download/repo/fc7/stable/x86_64/'
+ f7-i386-updates-lite: 'http://download.fedora.redhat.com/pub/fedora/linux/updates/7/i386/'
+ f7-x86_64-updates-lite: 'http://download.fedora.redhat.com/pub/fedora/linux/updates/7/x86_64/'
mirrors:
FC-7: [ '/media/dvdiso', '']
this_server:
hooks/update
---
Git Source Code Management System
hooks/update refs/heads/master \
b4d895fe439856ba81d25d6ab5f4b37d2532ef41 \
d8fd65b459653f1e6aa251275a293ef2c4fce854
More information about the Et-mgmt-commits-list
mailing list