Set pylint to ignore correct lines that it could not determine were correct,

due to the means by which eventlet.green imported subprocess
Minimized the number of these lines to ignore
This commit is contained in:
Alex Meade
2011-06-03 11:08:43 -04:00
parent 03db61c375
commit a19e56bff2

View File

@@ -142,24 +142,26 @@ def execute(*cmd, **kwargs):
env = os.environ.copy() env = os.environ.copy()
if addl_env: if addl_env:
env.update(addl_env) env.update(addl_env)
_PIPE = subprocess.PIPE #pylint: disable=E1101
obj = subprocess.Popen(cmd, obj = subprocess.Popen(cmd,
stdin=subprocess.PIPE, stdin=_PIPE,
stdout=subprocess.PIPE, stdout=_PIPE,
stderr=subprocess.PIPE, stderr=_PIPE,
env=env) env=env)
result = None result = None
if process_input is not None: if process_input is not None:
result = obj.communicate(process_input) result = obj.communicate(process_input)
else: else:
result = obj.communicate() result = obj.communicate()
obj.stdin.close() obj.stdin.close() #pylint: disable=E1101
if obj.returncode: _returncode = obj.returncode #pylint: disable=E1101
LOG.debug(_('Result was %s') % obj.returncode) if _returncode:
LOG.debug(_('Result was %s') % _returncode)
if type(check_exit_code) == types.IntType \ if type(check_exit_code) == types.IntType \
and obj.returncode != check_exit_code: and _returncode != check_exit_code:
(stdout, stderr) = result (stdout, stderr) = result
raise exception.ProcessExecutionError( raise exception.ProcessExecutionError(
exit_code=obj.returncode, exit_code=_returncode,
stdout=stdout, stdout=stdout,
stderr=stderr, stderr=stderr,
cmd=' '.join(cmd)) cmd=' '.join(cmd))