From 0b05e89e0d69857e45b7b7f401cd3d0304f42128 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 1 Feb 2007 19:19:16 +0000 Subject: [PATCH] make adt-virt-xenlvm work again --- virt-subproc/VirtSubproc.py | 3 +-- virt-subproc/adt-virt-xenlvm | 10 +++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/virt-subproc/VirtSubproc.py b/virt-subproc/VirtSubproc.py index 0fc61b5..97a9989 100644 --- a/virt-subproc/VirtSubproc.py +++ b/virt-subproc/VirtSubproc.py @@ -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 diff --git a/virt-subproc/adt-virt-xenlvm b/virt-subproc/adt-virt-xenlvm index 5cda2aa..02b07d4 100755 --- a/virt-subproc/adt-virt-xenlvm +++ b/virt-subproc/adt-virt-xenlvm @@ -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() -- 2.30.2