[Spacewalk-list] Spacewalk and SLES12 repo sync

James Miller jamesmillerjr at gmail.com
Mon Feb 20 15:42:18 UTC 2017


Hi Javier,

I was able to get it working, but with some changes to urlgrabber. Did you
have to make these changes on your system?  I'm able to successfully sync
those repos now.

http://lists.opensuse.org/opensuse-commit/2014-09/msg01140.html

/usr/lib/python2.7/site-packages/urlgrabber/mirror.py

+import urlparse

     def _join_url(self, base_url, rel_url):
-        if base_url.endswith('/') or rel_url.startswith('/'):
-            return base_url + rel_url
+        (scheme, netloc, path, query, fragid) = urlparse.urlsplit(base_url)
+        if path.endswith('/') or rel_url.startswith('/'):
+            return urlparse.urlunsplit((scheme, netloc, path + rel_url,
query,fragid))
         else:
-            return base_url + '/' + rel_url
-
+            return urlparse.urlunsplit((scheme, netloc, path + '/' +
rel_url,query, fragid))

Thank you,
James

On Mon, Feb 20, 2017 at 10:23 AM, Flores, Javier (D4\INF\IT ID) <
Javier.Flores at gmz.migros.ch> wrote:

> No need to grab the URL elsewhere or modify it. Use
> https://updates.suse.com/SUSE/Products/SLE-SERVER/12-SP2/
> x86_64/product?_api_key as the repository URL is all I needed to do.
>
>
>
> Can you wget https://updates.suse.com/SUSE/Products/SLE-SERVER/12-SP2/
> x86_64/product/repodata/repomd.xml?_api_key from your spacewalk server?
> If it works then your key should be ok.
>
> Regards,
>
> Javier
>
>
>
> *Von:* spacewalk-list-bounces at redhat.com [mailto:spacewalk-list-
> bounces at redhat.com] *Im Auftrag von *James Miller
> *Gesendet:* Freitag, 17. Februar 2017 19:01
> *An:* spacewalk-list at redhat.com
> *Betreff:* Re: [Spacewalk-list] Spacewalk and SLES12 repo sync
>
>
>
> Hi Javier,
>
>
>
> I got the URI from a registered VM using the zypper lr --uri command.
> Should I grab it from somewhere else or modify it in anyway?
>
>
>
> If I choose 'sync now' in the channel in spacewalk console, there are no
> errors and it says the sync completes in 2 seconds.
>
>
>
> Attempting to sync from cli, /usr/bin/spacewalk-repo-sync --channel sles12-sp2-pool
> --type yum is when I receive the error:
>
>
>
> 12:57:32 ERROR: failure: repodata/repomd.xml from
> SUSE_Products_SLE-SERVER_12-SP2_x86_64_product_api_key: [Errno 256] No
> more mirrors to try.
>
> https://updates.suse.com/SUSE/Products/SLE-SERVER/12-SP2/
> x86_64/product?api_key/repodata/repomd.xml: [Errno -1] Error importing
> repomd.xml for SUSE_Products_SLE-SERVER_12-SP2_x86_64_product_api_key:
> Damaged repomd.xml file
>
>
>
> Thank you,
>
>
>
> James
>
>
>
>
>
>
>
> On Fri, Feb 17, 2017 at 10:34 AM, Flores, Javier (D4\INF\IT ID) <
> Javier.Flores at gmz.migros.ch> wrote:
>
> Hi James,
>
>
>
> I have Spacewalk 2.6 running on CentOS since December and syncing SLES 12
> channels works.
>
>
>
> How did you get the URI with the long key? Did you register a VM directly
> to Suse and copied the URL from the zypper repos of that VM?
>
>
>
> The only issue I had after upgrading to Spacewalk 2.6 was this:
>
> https://www.redhat.com/archives/spacewalk-list/2016-December/msg00012.html
>
>
>
> Regards,
>
> Javier
>
>
>
> *Von:* spacewalk-list-bounces at redhat.com [mailto:spacewalk-list-
> bounces at redhat.com] *Im Auftrag von *James Miller
> *Gesendet:* Freitag, 17. Februar 2017 15:50
> *An:* spacewalk-list at redhat.com
> *Betreff:* [Spacewalk-list] Spacewalk and SLES12 repo sync
>
>
>
> Hello,
>
>
>
> Has anyone been able to successfully sync SLES12 repo's in Spacewalk 2.6
> (running on Centos 7)?  I'm attempting to use the URI from command  zypper
> lr --uri for each repository, but end up with errors.  Long key replaced
> with _api_key below.
>
>
>
> 09:40:26 ======================================
>
> 09:40:26 | Channel: sles12-sp2-pool
>
> 09:40:26 ======================================
>
> 09:40:26 Sync of channel started.
>
> 09:40:26 Repo URL: https://updates.suse.com/SUSE/
> Products/SLE-SERVER/12-SP2/x86_64/product?_api_key
>
> 09:40:29 ERROR: failure: repodata/repomd.xml from
> SUSE_Products_SLE-SERVER_12-SP2_x86_64_product_api_key_: [Errno 256] No
> more mirrors to try.
>
> https://updates.suse.com/SUSE/Products/SLE-SERVER/12-SP2/
> x86_64/product?_api_key/repodata/repomd.xml: [Errno -1] Error importing
> repomd.xml for SUSE_Products_SLE-SERVER_12-SP2_x86_64_product_api_key_:
> Damaged repomd.xml file
>
> 09:40:29 Sync of channel completed in 0:00:03.
>
>
>
> Thanks,
>
>
>
> James
>
>
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list
>
>
>
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20170220/7c24659c/attachment.htm>


More information about the Spacewalk-list mailing list