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-bugs

[Xen-bugs] [Bug 1685] New: xen drbd uname broken

To: xen-bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-bugs] [Bug 1685] New: xen drbd uname broken
From: bugzilla-daemon@xxxxxxxxxxxxxxxxxxx
Date: Tue, 9 Nov 2010 01:13:20 -0800
Delivery-date: Tue, 09 Nov 2010 01:14:06 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-bugs-request@lists.xensource.com?subject=help>
List-id: Xen Bugzilla <xen-bugs.lists.xensource.com>
List-post: <mailto:xen-bugs@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-bugs>, <mailto:xen-bugs-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-bugs>, <mailto:xen-bugs-request@lists.xensource.com?subject=unsubscribe>
Reply-to: bugs@xxxxxxxxxxxxxxxxxx
Sender: xen-bugs-bounces@xxxxxxxxxxxxxxxxxxx
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1685

           Summary: xen drbd uname broken
           Product: Xen
           Version: unstable
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Unspecified
        AssignedTo: xen-bugs@xxxxxxxxxxxxxxxxxxx
        ReportedBy: bg@xxxxxxx


in XendDomainInfo.py, there are several problems:

1) drbdadm state is debrecated, and the script tries to detect the
primary/secondary information from the deprecated message
2) os.popen2 does not work with the array as argument
3) popen2 is deprecated since python2.6

Here is a small patch, that resolves these issues for me:

--- XendDomainInfo.py.old       2010-11-08 10:27:53.000000000 +0100
+++ XendDomainInfo.py   2010-11-08 10:26:30.000000000 +0100
@@ -35,6 +35,7 @@
 import shutil
 import traceback
 from types import StringTypes
+from subprocess import *

 import xen.lowlevel.xc
 from xen.util import asserts, auxbin, mkdir
@@ -3298,7 +3299,9 @@
             if disk.find(":") != -1:
                 (disktype, diskname) = disk.split(':', 1)
                 if disktype == 'drbd':
-                    (drbdadmstdin, drbdadmstdout) =
os.popen2(["/sbin/drbdadm", "state", diskname])
+                    p = Popen(["/sbin/drbdadm", "role", diskname],
+                              stdin=PIPE, stdout=PIPE, close_fds=True )
+                    (drbdadmstdin, drbdadmstdout) = (p.stdin, p.stdout)
                     (state, junk) = drbdadmstdout.readline().split('/', 1)
                     if state == 'Secondary':
                         os.system('/sbin/drbdadm primary ' + diskname)


-- 
Configure bugmail: 
http://bugzilla.xensource.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

_______________________________________________
Xen-bugs mailing list
Xen-bugs@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-bugs

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-bugs] [Bug 1685] New: xen drbd uname broken, bugzilla-daemon <=