[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xen-bugs
Subject:    [Xen-bugs] [Bug 1685] New: xen drbd uname broken
From:       bugzilla-daemon () lists ! xensource ! com
Date:       2010-11-09 9:13:20
Message-ID: bug-1685-3 () http ! bugzilla ! xensource ! com/bugzilla/
[Download RAW message or body]

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@lists.xensource.com
        ReportedBy: bg@suse.de


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@lists.xensource.com
http://lists.xensource.com/xen-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic