[Et-mgmt-commits-list] [SCM] virt-factory branch, master now at 403d298340be81cd2ff2ca8d34c98ed993f5cb14

Michael DeHaan mdehaan at redhat.com
Tue Apr 10 21:06:35 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  403d298340be81cd2ff2ca8d34c98ed993f5cb14 (commit)
       via  6d3543550214f5ce4130367608a10f0029e25da2 (commit)
      from  d1f420d4c7cfb3fc98e8e6d2d279b08e57a73648 (commit)

- Log -----------------------------------------------------------------
commit 403d298340be81cd2ff2ca8d34c98ed993f5cb14
Merge: 6d35435... d1f420d...
Author: Michael DeHaan <mdehaan at mdehaan.rdu.redhat.com>
Date:   Tue Apr 10 17:07:36 2007 -0400

    Merge with git+ssh://g-mdehaan@et.redhat.com/git/virt-factory

commit 6d3543550214f5ce4130367608a10f0029e25da2
Author: Michael DeHaan <mdehaan at mdehaan.rdu.redhat.com>
Date:   Tue Apr 10 17:07:21 2007 -0400

    Adding support into VF for cobbler's feature of being able to mirror
    http:// and ftp:// repositories.  Initially, FC6 updates and extras
    will be mirrored.  Support needs to be added to cobbler to just get
    the relevant parts of extras, as extras actually contains too many
    packages (like games).  This should be configurable in the settings
    file for virt-factory.
-----------------------------------------------------------------------

Diffstat:
 service/kickstart/kick-fc6.ks   |    2 +-
 service/modules/provisioning.py |   45 +++++++++++++++++++++++++++++++++++++-
 service/settings                |    6 ++++-
 3 files changed, 49 insertions(+), 4 deletions(-)

diff --git a/service/kickstart/kick-fc6.ks b/service/kickstart/kick-fc6.ks
index 87a4e9e..555ab83 100755
--- a/service/kickstart/kick-fc6.ks
+++ b/service/kickstart/kick-fc6.ks
@@ -63,7 +63,7 @@ $node_virt_packages
 $node_bare_packages
 
 %post
-/usr/bin/sm_register $server_param $token_param
+/usr/bin/vf_register $server_param $token_param
 /sbin/chkconfig --level 345 puppetd on
 /sbin/chkconfig --level 345 virt-factory-node-server-daemon on
 # FIXME: configure node to use vf_repo here
diff --git a/service/modules/provisioning.py b/service/modules/provisioning.py
index 168abe8..1ac4a17 100755
--- a/service/modules/provisioning.py
+++ b/service/modules/provisioning.py
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 ## Virt-factory backend code.
 ##
-## Copyright 2006, Red Hat, Inc
+## Copyright 2006-2007, Red Hat, Inc
 ## Michael DeHaan <mdehaan at redhat.com>
 ## Scott Seago <sseago at redhat.com>
 ## Adrian Likins <alikins at redhat.com>
@@ -121,6 +121,15 @@ def input_string_or_hash(options,delim=","):
         options.pop('',None)
         return (True, options)
 
+#--------------------------------------------------------------------
+
+class CobblerTranslatedRepo:
+   def __init__(self,cobbler_api,name,url):
+       new_item = cobbler_api.new_repo()
+       new_item.set_name(name)
+       new_item.set_mirror(url)
+       cobbler_api.repos().add(new_item)
+       cobbler_api.serialize()
 
 #--------------------------------------------------------------------
 
@@ -167,8 +176,28 @@ class CobblerTranslatedProfile:
        # intentional.
        # use the same kickstart template for all profiles but template it out based on
        # distro, profile, and system settings. 
+       # --mpd
+
        new_item.set_kickstart("/var/lib/virt-factory/kick-fc6.ks")
 
+       # the repositories that this profile will use vary by architecture.  For now
+       # import only extras/updates and assume the distribution is FC-6.  The repos 
+       # to be imported are defined in the service configuration file and must match
+       # by name... I expect some (minor) pain in this when we support FC6/FC7 simultaneously.
+       # --mpd
+
+       repos = ['vf_repo']
+       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')
+
+       new_item.set_repos(repos)
+
        if from_db.has_key("kernel_options"):
            new_item.set_kernel_options(from_db["kernel_options"])
        
@@ -386,6 +415,8 @@ class Provisioning(web_svc.AuthWebSvc):
       profiles      = profiles.data
       machines      = machines.data
       deployments   = deployments.data
+       
+      vf_config = config_data.Config().get()
       
       # FIXME: (IMPORTANT) update cobbler config from virt-factory config each time, in particular,
       # the server field might have changed.
@@ -393,15 +424,20 @@ class Provisioning(web_svc.AuthWebSvc):
       try:
          cobbler_api = cobbler.api.BootAPI()
          cobbler_api.sync()
+         cobbler_repos    = cobbler_api.repos()   
          cobbler_distros  = cobbler_api.distros()
          cobbler_profiles = cobbler_api.profiles()
          cobbler_systems  = cobbler_api.systems()
          cobbler_distros.clear()
          cobbler_profiles.clear()
          cobbler_systems.clear()
+         cobbler_repos.clear()
          
          # cobbler can/will could raise exceptions on failure at any point...
          # return code checking is not needed.
+         for r in vf_config["repos"].keys():
+            print "- repository: %s" % r
+            CobblerTranslatedRepo(cobbler_api,r,vf_config["repos"][r])
          for d in distributions:
             print "- distribution: %s" % d
             CobblerTranslatedDistribution(cobbler_api,d)
@@ -414,6 +450,7 @@ class Provisioning(web_svc.AuthWebSvc):
          for dp in deployments:
             print "- deployment: %s" % dp
             CobblerTranslatedSystem(cobbler_api,profiles,dp)
+         
 
          cobbler_api.serialize()
          cobbler_api.sync()
@@ -474,7 +511,11 @@ class Provisioning(web_svc.AuthWebSvc):
 
         print NOW_IMPORTING
 
-        # FIXME
+        # 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)
+        cobbler_api.reposync() 
 
         # read the config entry to find out cobbler's mirror locations
         for mirror_name in vf_config["mirrors"]:
diff --git a/service/settings b/service/settings
index 01688f0..3e92c35 100755
--- a/service/settings
+++ b/service/settings
@@ -3,7 +3,11 @@ databases:
     primary: /var/lib/virt-factory/primary_db
 logs:
     service: /var/log/virt-factory/svclog
+repos:
+    vf_repo: 'http://virt-factory.et.redhat.com/download/repo/fc6/stable/i386/'
+    fc6i386extras: 'http://mirrors.kernel.org/fedora/extras/6/i386/'
+    fc6x86_64extras: 'http://mirrors.kernel.org/fedora/extras/6/x86_64/'
 mirrors:
-    FC-6: 'rsync://rsync.devel.redhat.com/engarchive/released/FC-6/GOLD'
+    FC-6: '/media/dvdiso'
 this_server:
     address: '127.0.0.1'

hooks/update
---
Git Source Code Management System
hooks/update refs/heads/master \
  d1f420d4c7cfb3fc98e8e6d2d279b08e57a73648 \
  403d298340be81cd2ff2ca8d34c98ed993f5cb14




More information about the Et-mgmt-commits-list mailing list