Hi,

Am Freitag, 8. April 2011, 14:49:30 schrieb Michael Calmer:
> Hi,
> 
> 
> 0002-enhance-getOSVersionAndRelease-to-find-SUSE-distribu.patch:
> Add code to make _getOSVerionAndRelease work on SUSE

This patch has a little typo. I have attached a fixed version.
Sorry :-)

-- 
Regards,

        Michael Calmer

--------------------------------------------------------------------------
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--------------------------------------------------------------------------
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From 4ea53dfc537e92fd870cd414fc901edb83f7d288 Mon Sep 17 00:00:00 2001
From: Michael Calmer <m...@suse.de>
Date: Mon, 4 Apr 2011 11:12:04 +0200
Subject: [PATCH 02/17] enhance getOSVersionAndRelease to find SUSE distributions

---
 .../src/up2date_client/up2dateUtils.py             |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/client/rhel/rhn-client-tools/src/up2date_client/up2dateUtils.py b/client/rhel/rhn-client-tools/src/up2date_client/up2dateUtils.py
index fc33ad1..f7d064f 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/up2dateUtils.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/up2dateUtils.py
@@ -32,11 +32,17 @@ else:
             osVersionRelease = (h['name'], h['version'], h['release'])
             return osVersionRelease
         else:
-            raise up2dateErrors.RpmError(
-                "Could not determine what version of Red Hat Linux you "\
-                "are running.\nIf you get this error, try running \n\n"\
-                "\t\trpm --rebuilddb\n\n")
-
+            for h in ts.dbMatch('Providename', "distribution-release"):
+                osVersionRelease = (h['name'], h['version'], h['release'])
+                # zypper requires a exclusive lock on the rpmdb. So we need
+                # to close it here.
+                ts.ts.closeDB()
+                return osVersionRelease
+            else:
+                raise up2dateErrors.RpmError(
+                    "Could not determine what version of Red Hat Linux you "\
+                    "are running.\nIf you get this error, try running \n\n"\
+                    "\t\trpm --rebuilddb\n\n")
 
 def getVersion():
     '''
-- 
1.7.3.4

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to