diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2009-02-09 02:00:22 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2009-02-09 02:00:22 +0000 |
commit | a6393d5baa635739672fe2561dafea30f8f2652c (patch) | |
tree | 82ab5cdb14579c8813dd6354cfccd8c275089610 /src/lib/Client | |
parent | 6b494128bec736187ad1a5c7d1d664924b8f983e (diff) | |
download | bcfg2-a6393d5baa635739672fe2561dafea30f8f2652c.tar.gz bcfg2-a6393d5baa635739672fe2561dafea30f8f2652c.tar.bz2 bcfg2-a6393d5baa635739672fe2561dafea30f8f2652c.zip |
revert subprocess changes for the moment as well
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5070 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client')
-rw-r--r-- | src/lib/Client/Tools/__init__.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/lib/Client/Tools/__init__.py b/src/lib/Client/Tools/__init__.py index ad0740992..d44356f9b 100644 --- a/src/lib/Client/Tools/__init__.py +++ b/src/lib/Client/Tools/__init__.py @@ -9,24 +9,16 @@ __all__ = ["Action", "APT", "Blast", "Chkconfig", "DebInit", "Encap", drivers = [item for item in __all__ if item not in ['rpmtools']] default = [item for item in drivers if item not in ['RPM', 'Yum']] -import os -try: - from subprocess import Popen -except: - from popen2 import Popen4 as Popen -import stat -import sys -import time -import Bcfg2.Client.XML +import os, popen2, stat, sys, Bcfg2.Client.XML, time class toolInstantiationError(Exception): '''This error is called if the toolset cannot be instantiated''' pass -class readonlypipe(Popen): +class readonlypipe(popen2.Popen4): '''This pipe sets up stdin --> /dev/null''' def __init__(self, cmd, bufsize=-1): - self.__module__._cleanup() + popen2._cleanup() c2pread, c2pwrite = os.pipe() null = open('/dev/null', 'w+') self.pid = os.fork() @@ -39,7 +31,7 @@ class readonlypipe(Popen): self._run_child(cmd) os.close(c2pwrite) self.fromchild = os.fdopen(c2pread, 'r', bufsize) - self.__module__._active.append(self) + popen2._active.append(self) class executor: '''this class runs stuff for us''' |