Hi All,

Back again, been a bit busy, have kind if found a workaround and maybe a why, 
but have no idea how this is happening... Any thoughts, gratefully received.

> >
> > [EMAIL PROTECTED] ~]# reposync -a i386 -r updates -p test/
> >
> >
> > So it seems reposync works as expected. However using
> cobbler reposync it still fails.
> >
> >
>
> But you're not calling it the same way.  If you look at the
> output, Cobbler is doing:
>
>
> > - /usr/bin/reposync
> >
> --config=/var/www/cobbler/repo_mirror/.origin/CentOS5-i386upda
> tes.repo
> > --repoid=CentOS5-i386updates
>
>
> That will run exactly the same way, which should help you
> figure out what the problem is.


Ahhh, see what you mean. Ran through a few tests to work out what is going on, 
but tbh am a bit confused here, here's what happened.

As you mentioned, I wasn't calling it in the same way, so (starting from 
fresh)...

[EMAIL PROTECTED] ~]# cobbler repo add cobbler repo add --name=c5i386updates 
--mirror=http://www.mirrorservice.org/sites/mirror.centos.org/5/updates/i386/ 
--arch=i386
[EMAIL PROTECTED] ~]# cobbler sync
[EMAIL PROTECTED] ~]# cobbler reposync
- creating: /var/www/cobbler/repo_mirror/.origin/c5i386updates.repo
- /usr/bin/reposync 
--config=/var/www/cobbler/repo_mirror/.origin/c5i386updates.repo 
--repoid=c5i386updates --download_path=/var/www/cobbler/repo_mirror -a i386
Traceback (most recent call last):
  File "/usr/bin/reposync", line 264, in ?
    main()
  File "/usr/bin/reposync", line 177, in main
    my.doSackSetup(rpmUtils.arch.getArchList(opts.arch))
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 367, in 
doSackSetup
    return self._getSacks(archlist=archlist, thisrepo=thisrepo)
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 392, in 
_getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.4/site-packages/yum/repos.py", line 242, in 
populateSack
    sack.populate(repo, mdtype, callback, cacheonly)
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 143, in populate
    if self._check_db_version(repo, mydbtype):
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 200, in 
_check_db_version
    if repo.repoXML.repoData.has_key(mdtype):
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 781, in <lambda>
    repoXML = property(fget=lambda self: self._getRepoXML(),
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 777, in 
_getRepoXML
    raise Errors.RepoError, msg
yum.Errors.RepoError: Cannot retrieve repository metadata (repomd.xml) for 
repository: c5i386updates. Please verify its path and try again
cobbler reposync failed

Grrr...

[EMAIL PROTECTED] ~]# reposync 
--config=/var/www/cobbler/repo_mirror/.origin/c5i386updates.repo 
--repoid=c5i386updates --download_path=/var/www/cobbler/repo_mirror -a i386
Traceback (most recent call last):
  File "/usr/bin/reposync", line 264, in ?
    main()
  File "/usr/bin/reposync", line 177, in main
    my.doSackSetup(rpmUtils.arch.getArchList(opts.arch))
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 367, in 
doSackSetup
    return self._getSacks(archlist=archlist, thisrepo=thisrepo)
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 392, in 
_getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.4/site-packages/yum/repos.py", line 242, in 
populateSack
    sack.populate(repo, mdtype, callback, cacheonly)
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 143, in populate
    if self._check_db_version(repo, mydbtype):
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 200, in 
_check_db_version
    if repo.repoXML.repoData.has_key(mdtype):
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 781, in <lambda>
    repoXML = property(fget=lambda self: self._getRepoXML(),
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 777, in 
_getRepoXML
    raise Errors.RepoError, msg
yum.Errors.RepoError: Cannot retrieve repository metadata (repomd.xml) for 
repository: c5i386updates. Please verify its path and try again

So it doesn't work either. After some poking around, it seems it's the config 
file that causes the error, but wasn't sure why...

Creating a separate config file...
[EMAIL PROTECTED] ~]# cat ~/cobblerrepos.conf
[c5i386updates]
name=c5i386updates
baseurl=http://www.mirrorservice.org/sites/mirror.centos.org/5/updates/i386/
enabled=1
gpgcheck=0

Which is the same (apart from the priority, did remove, no difference) as the 
generated /var/www/cobbler/repo_mirror/.origin/c5i386updates.repo
[EMAIL PROTECTED] ~]# cat 
/var/www/cobbler/repo_mirror/.origin/c5i386updates.repo
[c5i386updates]
name=c5i386updates
baseurl=http://www.mirrorservice.org/sites/mirror.centos.org/5/updates/i386/
enabled=1
priority=99
gpgcheck=0

[EMAIL PROTECTED] ~]# reposync --config=~/cobblerrepos.conf 
--repoid=c5i386updates --download_path=/var/www/cobbler/repo_mirror -a i386

Again this fails. However I did notice (whilst mis-typing) that 
--repoid=updates got much further.
After adding the above repo definition into my standard yum repos 
(/etc/yum.repos.d) the above command worked fine.

After some more digging, if I add [main] and my proxy details to the top of the 
conf file, all works fine. Eg
[EMAIL PROTECTED] ~]# cat ~/cobblerrepos.conf
[main]
proxy=http://proxy.ad.kew.org:8080
[c5i386updates]
name=c5i386updates
baseurl=http://www.mirrorservice.org/sites/mirror.centos.org/5/updates/i386/
enabled=1
gpgcheck=0

[EMAIL PROTECTED] cobbler]# reposync --config=~/cobberrepos.conf 
--repoid=c5i386updates --download_path=/var/www/cobbler/repo_mirror -a i386
c5i386updates             100% |=========================|  951 B    00:00
[c5i386updates: 1     of 329   ] Skipping existing 
RPMS/Cluster_Administration-as-IN-5.2-1.el5.centos.noarch.rpm
[c5i386updates: 2     of 329   ] Skipping existing 
RPMS/Cluster_Administration-bn-IN-5.2-1.el5.centos.noarch.rpm
[c5i386updates: 3     of 329   ] Downloading 
RPMS/Cluster_Administration-de-DE-5.2-1.el5.centos.noarch.rpm
Cluster_Administration-de 100% |=========================| 1.7 MB    00:02
[c5i386updates: 4     of 329   ] Downloading 
RPMS/Cluster_Administration-en-US-5.2-1.el5.centos.noarch.rpm

So... It seems that somehow the proxy info isn't being passed into reposync as 
expected. Which is just strange. I have configured the proxy info within 
/etc/profile so it should be hard-wired in there somewhere. It is also within 
/etc/yum.conf although I guess with a --config parameter it ignores and 
presumes you have it within the new config file.

As an experiment, I edited the source and added a couple of lines to the 
action_reposync.py create_local_file funtion (diff below).

[EMAIL PROTECTED] cobbler]# diff -ruN ~/action_reposync.py 
/usr/lib/python2.4/site-packages/cobbler/action_reposync.py
--- /root/action_reposync.py    2008-07-21 15:07:26.000000000 +0100
+++ /usr/lib/python2.4/site-packages/cobbler/action_reposync.py 2008-07-21 
15:10:07.000000000 +0100
@@ -252,6 +252,8 @@
         if not os.path.exists(dest_path):
             utils.mkdir(dest_path)
         config_file = open(fname, "w+")
+       config_file.write("[main]\n")
+       config_file.write("proxy=http://proxy.ad.kew.org:8080\n";)
         config_file.write("[%s]\n" % repo.name)
         config_file.write("name=%s\n" % repo.name)
         optenabled = False

This is obviously just a test, but it works like a charm :)  Hurrah!!!
As mentioned earlier, don't know exactly whether this is a bug, by design or 
whatever. I can't believe I am the first to be using cobbler reposync with a 
proxy (not managed by me, is a ISA box), so maybe it's an oddity or something. 
Is it a failing in reposync/yum and needs reporting as such, or is it designed 
that way and hence Cobbler needs updating???

No idea, however hope this info is of use to someone.

Thanks

Dan

--
Dan Hawker
[EMAIL PROTECTED]
UNIX & Comms
Royal Botanic Gardens - Kew
--

"I love deadlines. I like the whooshing sound they make as they fly by" - 
Douglas Adams

--
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler

Reply via email to