Merge "Fix loguserdata output to file issue"

This commit is contained in:
Jenkins 2013-07-24 18:15:16 +00:00 committed by Gerrit Code Review
commit eade86a674
2 changed files with 9 additions and 5 deletions

View File

@ -47,14 +47,15 @@ def call(args):
def write(self, data):
LOG.info(data)
def __getattr__(self, attr):
return getattr(sys.stdout, attr)
LOG.info('%s\n' % ' '.join(args))
try:
ls = LogStream()
p = subprocess.Popen(args, stdout=ls, stderr=ls)
p.wait()
p = subprocess.Popen(args, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
data = p.communicate()
if data:
for x in data:
ls.write(x)
except OSError as ex:
if ex.errno == errno.ENOEXEC:
LOG.error('Userdata empty or not executable: %s\n' % str(ex))

View File

@ -34,6 +34,9 @@ class FakePOpen(object):
def wait(self):
pass
def communicate(self, input=None):
pass
class LoguserdataTest(HeatTestCase):