Hi,

here is a set of 5 patches. One enhancement and 4 fixes:

0001:
add openSUSE-12.3 to spacewalk-common-channels-config

0002:
do not read rpm into memory before transferring to client

0003:
do not call not existing function

0004:
catch libvirtError to return meaningfull error messages

0005:
isInstallerConfig should check for autoyast in commandline


-- 
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: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
>From 12daf0a61d1cc6b6e806896102fd94b6f78083d6 Mon Sep 17 00:00:00 2001
From: Michael Calmer <m...@suse.de>
Date: Wed, 13 Mar 2013 16:06:11 +0100
Subject: [PATCH 1/5] add openSUSE 12.3 to spacewalk-common-channels config

---
 utils/spacewalk-common-channels.ini | 52 +++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/utils/spacewalk-common-channels.ini b/utils/spacewalk-common-channels.ini
index cc5dbac..5a38984 100644
--- a/utils/spacewalk-common-channels.ini
+++ b/utils/spacewalk-common-channels.ini
@@ -723,6 +723,14 @@ checksum = sha1
 base_channels = opensuse12_2-%(arch)s
 yumrepo_url = http://download.opensuse.org/update/12.2/
 
+[opensuse12_2-non-oss-updates]
+label    = %(base_channel)s-non-oss-updates
+name     = openSUSE 12.2 non oss Updates (%(arch)s)
+archs    = i586, x86_64
+checksum = sha1
+base_channels = opensuse12_2-%(arch)s
+yumrepo_url = http://download.opensuse.org/update/12.2-non-oss/
+
 [spacewalk18-client-opensuse12_2]
 name     = Spacewalk Client 1.8 %(base_channel_name)s
 archs    = i586, x86_64
@@ -732,3 +740,47 @@ gpgkey_url = http://download.opensuse.org/repositories/systemsmanagement:/spacew
 gpgkey_id = A0E46E11
 gpgkey_fingerprint = 68D3 3874 9967 0AEB D988  2DB3 2ABF A143 A0E4 6E11
 yumrepo_url = http://download.opensuse.org/repositories/systemsmanagement:/spacewalk:/1.8/openSUSE_12.2/
+
+[opensuse12_3]
+checksum = sha256
+archs    = i586, x86_64
+name     = openSUSE 12.3 (%(arch)s)
+gpgkey_url = http://download.opensuse.org/distribution/12.3/repo/oss/suse/repodata/repomd.xml.key
+gpgkey_id = 3DBDC284
+gpgkey_fingerprint = 22C0 7BA5 3417 8CD0 2EFE  22AA B88B 2FD4 3DBD C284
+yumrepo_url = http://download.opensuse.org/distribution/12.3/repo/oss/suse/
+dist_map_release = 12.3
+
+[opensuse12_3-non-oss]
+label    = %(base_channel)s-non-oss
+name     = openSUSE 12.3 non oss (%(arch)s)
+archs    = i586, x86_64
+checksum = sha256
+base_channels = opensuse12_3-%(arch)s
+yumrepo_url = http://download.opensuse.org/distribution/12.3/repo/non-oss/suse/
+
+[opensuse12_3-updates]
+label    = %(base_channel)s-updates
+name     = openSUSE 12.3 Updates (%(arch)s)
+archs    = i586, x86_64
+checksum = sha256
+base_channels = opensuse12_3-%(arch)s
+yumrepo_url = http://download.opensuse.org/update/12.3/
+
+[opensuse12_3-non-oss-updates]
+label    = %(base_channel)s-non-oss-updates
+name     = openSUSE 12.3 non oss Updates (%(arch)s)
+archs    = i586, x86_64
+checksum = sha256
+base_channels = opensuse12_3-%(arch)s
+yumrepo_url = http://download.opensuse.org/update/12.3-non-oss/
+
+[spacewalk19-client-opensuse12_3]
+name     = Spacewalk Client 1.9 %(base_channel_name)s
+archs    = i586, x86_64
+base_channels = opensuse12_3-%(arch)s
+checksum = sha256
+gpgkey_url = http://download.opensuse.org/repositories/systemsmanagement:/spacewalk:/1.9/openSUSE_12.3/repodata/repomd.xml.key
+gpgkey_id = A0E46E11
+gpgkey_fingerprint = 68D3 3874 9967 0AEB D988  2DB3 2ABF A143 A0E4 6E11
+yumrepo_url = http://download.opensuse.org/repositories/systemsmanagement:/spacewalk:/1.9/openSUSE_12.3/
-- 
1.8.2

>From 6c9d20e0c76e22a50de4ffc24d544da676d54479 Mon Sep 17 00:00:00 2001
From: Hubert Mantel <man...@suse.de>
Date: Thu, 14 Mar 2013 16:39:43 +0100
Subject: [PATCH 2/5] do not read rpm into memory before transferring to client
 (bnc#801151)

---
 backend/server/apacheRequest.py | 50 ++++++++++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 21 deletions(-)

diff --git a/backend/server/apacheRequest.py b/backend/server/apacheRequest.py
index cd61870..a30f714 100644
--- a/backend/server/apacheRequest.py
+++ b/backend/server/apacheRequest.py
@@ -264,27 +264,35 @@ class apacheRequest:
 
         # send the headers
         self.req.send_http_header()
-        # and the file
-        read = 0
-        while read < response_size:
-            # We check the size here in case we're not asked for the entire file.
-            if (read + CFG.BUFFER_SIZE > response_size):
-                to_read = read + CFG.BUFFER_SIZE - response_size
-            else:
-                to_read = CFG.BUFFER_SIZE
-            buf = response.read(CFG.BUFFER_SIZE)
-            if not buf:
-                break
-            try:
-                self.req.write(buf)
-                read = read + CFG.BUFFER_SIZE
-            except IOError:
-                if xrepcon:
-                    # We're talking to a proxy, so don't bother to report
-                    # a SIGPIPE
-                    break
-                return apache.HTTP_BAD_REQUEST
-        response.close()
+
+        if self.req.headers_in.has_key("Range"):
+	    # and the file
+	    read = 0
+	    while read < response_size:
+		# We check the size here in case we're not asked for the entire file.
+		if (read + CFG.BUFFER_SIZE > response_size):
+		    to_read = read + CFG.BUFFER_SIZE - response_size
+		else:
+		    to_read = CFG.BUFFER_SIZE
+		buf = response.read(CFG.BUFFER_SIZE)
+		if not buf:
+		    break
+		try:
+		    self.req.write(buf)
+		    read = read + CFG.BUFFER_SIZE
+		except IOError:
+		    if xrepcon:
+			# We're talking to a proxy, so don't bother to report
+			# a SIGPIPE
+			break
+		    return apache.HTTP_BAD_REQUEST
+	    response.close()
+        else:
+            if 'wsgi.file_wrapper' in self.req.headers_in:
+		self.req.output = self.req.headers_in['wsgi.file_wrapper'](response, CFG.BUFFER_SIZE)
+	    else:
+		self.req.output = iter(lambda: response.read(CFG.BUFFER_SIZE), '')
+
         return success_response
 
     # send the response (common code)
-- 
1.8.2

>From b3611b5ac3d142616e4364cf492bd2cca3415f51 Mon Sep 17 00:00:00 2001
From: Michael Calmer <m...@suse.de>
Date: Wed, 20 Mar 2013 12:07:37 +0100
Subject: [PATCH 3/5] do not call not existing function

fixes:
Traceback (most recent call last):
  File "/usr/sbin/rhn_check", line 343, in __run_action
    (status, message, data) = CheckCli.__do_call(method, params, kwargs)
  File "/usr/sbin/rhn_check", line 336, in __do_call
    retval = method(*params, **kwargs)
  File "/usr/share/rhn/actions/kickstart_guest.py", line 52, in initiate
    virt_type, name, mem_kb, vcpus, disk_gb, virt_bridge, disk_path, extra_append, log_notify_handler)
  File "/usr/share/rhn/spacewalkkoan/spacewalkkoan.py", line 261, in initiate_guest
    error_messages['koan'] = xb.get_error_message() + ' ' + string.join(traceback.format_list(traceback.extract_tb(tb)))
<type 'exceptions.AttributeError'>: 'VirtDiskPathExistsError' object has no attribute 'get_error_message'
---
 client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py b/client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py
index 9a2d606..0c5d991 100644
--- a/client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py
+++ b/client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py
@@ -258,7 +258,7 @@ def initiate_guest(kickstart_host, cobbler_system_name, virt_type, name, mem_kb,
             print xa
             print xb
             print string.join(traceback.format_list(traceback.extract_tb(tb)))
-            error_messages['koan'] = xb.get_error_message() + ' ' + string.join(traceback.format_list(traceback.extract_tb(tb)))
+            error_messages['koan'] = str(xb) + ' ' + string.join(traceback.format_list(traceback.extract_tb(tb)))
         return (1, "Virtual kickstart failed. Koan error.", error_messages)
 
     return (0, "Virtual kickstart initiate succeeded", error_messages)
-- 
1.8.2

>From 3f63ee4226392d7df095accdb248763b957d02ee Mon Sep 17 00:00:00 2001
From: Michael Calmer <m...@suse.de>
Date: Thu, 21 Mar 2013 10:41:23 +0100
Subject: [PATCH 4/5] catch libvirtError to return meaningfull error messages

---
 client/tools/rhn-virtualization/virtualization/domain_control.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/client/tools/rhn-virtualization/virtualization/domain_control.py b/client/tools/rhn-virtualization/virtualization/domain_control.py
index fa5c8e8..9b29a9d 100755
--- a/client/tools/rhn-virtualization/virtualization/domain_control.py
+++ b/client/tools/rhn-virtualization/virtualization/domain_control.py
@@ -145,6 +145,10 @@ def _call_domain_control_routine(uuid, routine_name, *args):
         raise VirtualizationException, \
               "Invalid arguments (%s) to %s: %s" % \
                   (str(args), routine_name, str(te)), sys.exc_info()[2]
+    except libvirt.libvirtError, le:
+        raise VirtualizationException, \
+              "LibVirt Error %s: %s" % \
+                  (routine_name, str(le)), sys.exc_info()[2]
     
     # Handle the return code.  Anything non-zero is an error.
     if result != 0:
-- 
1.8.2

>From 99465828ffe391ddc9c4317c8f9f93e474681cb1 Mon Sep 17 00:00:00 2001
From: Michael Calmer <m...@suse.de>
Date: Thu, 21 Mar 2013 12:04:18 +0100
Subject: [PATCH 5/5] isInstallerConfig should check for autoyast in
 commandline

---
 client/tools/rhn-virtualization/virtualization/domain_config.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/client/tools/rhn-virtualization/virtualization/domain_config.py b/client/tools/rhn-virtualization/virtualization/domain_config.py
index a0f053d..76f1743 100644
--- a/client/tools/rhn-virtualization/virtualization/domain_config.py
+++ b/client/tools/rhn-virtualization/virtualization/domain_config.py
@@ -175,7 +175,9 @@ class DomainConfig:
             
             # Look for the "method" argument.  This is a good indication that
             # the instance is in the installer.
-            if command_line_dict.has_key("method") or command_line_dict.has_key("ks"):
+            if (command_line_dict.has_key("method") or
+                command_line_dict.has_key("ks") or
+                command_line_dict.has_key("autoyast")):
                 result = 1
 
         return result
-- 
1.8.2

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

Reply via email to