[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.