diff options
| author | Alex Meade <alex.meade@rackspace.com> | 2011-06-03 11:08:43 -0400 |
|---|---|---|
| committer | Alex Meade <alex.meade@rackspace.com> | 2011-06-03 11:08:43 -0400 |
| commit | 5b00ca3ac874d0fff1eb2835cd4219f49d8a169f (patch) | |
| tree | 99e3d0fa9bb98a49e8b728bc02f950c1b0d99ec6 | |
| parent | a9f21962a9e1e703730fbfae120129618b7a79ca (diff) | |
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
| -rw-r--r-- | nova/utils.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/nova/utils.py b/nova/utils.py index 361fc9873..4e1b7c26a 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -142,24 +142,26 @@ def execute(*cmd, **kwargs): env = os.environ.copy() if addl_env: env.update(addl_env) + _PIPE = subprocess.PIPE #pylint: disable=E1101 obj = subprocess.Popen(cmd, - stdin=subprocess.PIPE, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + stdin=_PIPE, + stdout=_PIPE, + stderr=_PIPE, env=env) result = None if process_input is not None: result = obj.communicate(process_input) else: result = obj.communicate() - obj.stdin.close() - if obj.returncode: - LOG.debug(_('Result was %s') % obj.returncode) + obj.stdin.close() #pylint: disable=E1101 + _returncode = obj.returncode #pylint: disable=E1101 + if _returncode: + LOG.debug(_('Result was %s') % _returncode) if type(check_exit_code) == types.IntType \ - and obj.returncode != check_exit_code: + and _returncode != check_exit_code: (stdout, stderr) = result raise exception.ProcessExecutionError( - exit_code=obj.returncode, + exit_code=_returncode, stdout=stdout, stderr=stderr, cmd=' '.join(cmd)) |
