WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] pvscsi xend python syntax problem

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] pvscsi xend python syntax problem
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Mon, 20 Oct 2008 14:35:42 +0100
Cc: Jun Kamada <kama@xxxxxxxxxxxxxx>, Tomonari Horikoshi <t.horikoshi@xxxxxxxxxxxxxx>
Delivery-date: Mon, 20 Oct 2008 06:36:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
xen-unstable changeset 17959:6ae87b27cc contains a syntax error in
vscsi_get_scsidevices:

  File 
"/local/scratch/xenrt/xenrtbuildH17919/build/dist/install/usr/lib/python/xen/util/vscsi_util.py",
 line 126, in vscsi_get_scsidevices
UnboundLocalError: local variable 'sg' referenced before assignment

This is because the loop tries to add the device, including
information about its sg, without first setting sg.  I've grepped the
code and setting sg to None seems the safest bet.

Ian.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

diff -r 4129f0f2f2ba tools/python/xen/util/vscsi_util.py
--- a/tools/python/xen/util/vscsi_util.py       Fri Oct 17 14:15:37 2008 +0100
+++ b/tools/python/xen/util/vscsi_util.py       Mon Oct 20 14:34:31 2008 +0100
@@ -122,6 +122,8 @@ def vscsi_get_scsidevices():
                         scsi_id = '-'
                     else:
                         scsi_id = lines[0]
+                else:
+                    sg = None
 
             devices.append([hctl, block, sg, scsi_id])
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>