diff options
| author | Alex Meade <alex.meade@rackspace.com> | 2011-06-07 21:25:33 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-06-07 21:25:33 +0000 |
| commit | 8ff87c649e13e21ba968ec85a1158230e8cf118d (patch) | |
| tree | 27f1b89c65404d1bc5033d94f648fa1bb4625849 /nova/utils.py | |
| parent | 762afdd426c35d1fc82cb7a17683a50ff21e717e (diff) | |
| parent | 641f16a5343ca5d95ea10ec5031a27a7f131c337 (diff) | |
Cleaned up some of the larger pylint errors. Set to ignore some lines that pylint just couldn't understand.
Diffstat (limited to 'nova/utils.py')
| -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 b1638e72c..691134ada 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)) |
