chiark / gitweb /
make adt-virt-xenlvm work again
authorIan Jackson <ian@anarres>
Thu, 1 Feb 2007 19:19:16 +0000 (19:19 +0000)
committerIan Jackson <ian@anarres>
Thu, 1 Feb 2007 19:19:16 +0000 (19:19 +0000)
virt-subproc/VirtSubproc.py
virt-subproc/adt-virt-xenlvm

index 0fc61b5703bd43790d92e20f7f751ea198a8898e..97a99896cf0a405eb89af8f808e6661709ec97a3 100644 (file)
@@ -251,8 +251,7 @@ def command():
        r = f(c, ce)
        if not r: r = []
        r.insert(0, 'ok')
-       ru = map(urllib.quote, r)
-       print string.join(ru)
+       print string.join(r)
 
 def cleanup():
        global downtmp, cleaning
index 5cda2aab8799205f65ef626a4de5fe79237431e5..02b07d409d36d41d53fe78e6a8828924776d3fbf 100755 (executable)
@@ -26,6 +26,7 @@ import sys
 import os
 import re as regexp
 import string
+import subprocess
 from optparse import OptionParser
 
 try: our_base = os.environ['AUTOPKGTEST_BASE']
@@ -34,7 +35,7 @@ sys.path.insert(1, our_base+'/python')
 
 import VirtSubproc as vsp
 
-witholder = None
+withholder = None
 downtmp = '/root/adt-downtmp'
 
 def parse_args():
@@ -51,11 +52,12 @@ def parse_args():
        (opts,xlargs) = parser.parse_args()
        vsp.debuglevel = opts.debug
 
-       if opts.gain_root = None: gain_root = []
+       if opts.gain_root is None: gain_root = []
        else: gain_root = opts.gain_root.split()
        vsp.down = gain_root + ['adt-xenlvm-on-testbed'] + xlargs + ['--']
 
 def do_open():
+       global withholder
        assert(withholder is None)
        withholder = subprocess.Popen(
                gain_root + ['adt-xenlvm-with-testbed'] + xlargs +
@@ -74,6 +76,7 @@ def do_open():
        vsp.execute('mkdir %s' % downtmp, downp=True)   
 
 def do_close():
+       global withholder
        withholder.stdin.close()
        withholder.stdout.close()
        rc = withholder.wait()
@@ -90,11 +93,12 @@ def hook_reset():
        do_open()
 
 def hook_cleanup():
+       global withholder
        if withholder is not None:
                do_close()
 
 def hook_capabilities():
-       return ('revert','root-on-testbed','suggest-normal-user=adtxenu')
+       return ['revert','root-on-testbed','suggest-normal-user=adtxenu']
 
 parse_args()
 vsp.main()