diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2014-04-04 18:54:58 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2014-04-04 19:32:28 +0100 |
commit | af9e7041f766f42385870d55498da6032059f601 (patch) | |
tree | 58edf9cf4e57fefc75788763a8e0b590e5865b2e /sos/plugins/postgresql.py | |
parent | e876737a6938a1ee6a6322b8d4f619ef87a7ccde (diff) | |
download | sos-af9e7041f766f42385870d55498da6032059f601.tar.gz |
Clean up sos_get_command_output() and friends
Returning a 3-tuple has always been ugly. It gets worse as the
parameter list for this family of functions grows. Worse, the 3rd
member of the tuple is unused and is always set to 0.
Rip the whole mess out and return a single, simple dictionary
object with 'status' and 'output' keys.
Update utilities_tests to reflect the new interface.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Diffstat (limited to 'sos/plugins/postgresql.py')
-rw-r--r-- | sos/plugins/postgresql.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sos/plugins/postgresql.py b/sos/plugins/postgresql.py index 69084af0..290b6a5d 100644 --- a/sos/plugins/postgresql.py +++ b/sos/plugins/postgresql.py @@ -60,17 +60,17 @@ class PostgreSQL(Plugin): dest_file, self.get_option("dbname") ) - (status, output, rtime) = self.call_ext_prog(cmd) + result = self.call_ext_prog(cmd) if old_env_pgpassword is not None: os.environ["PGPASSWORD"] = str(old_env_pgpassword) - if (status == 0): + if (result['status'] == 0): self.add_copy_spec(dest_file) else: self.soslog.error( - "Unable to execute pg_dump. Error(%s)" % (output) + "Unable to execute pg_dump. Error(%s)" % (result['output']) ) self.add_alert( - "ERROR: Unable to execute pg_dump. Error(%s)" % (output) + "ERROR: Unable to execute pg_dump. Error(%s)" % (result['output']) ) def setup(self): |