From e17afe178fcfb99670a9712740a71c54c403f80c Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Sun, 15 Aug 2021 20:10:43 +0100 Subject: [PATCH] Antilint --- .../datman_helper_postgres/backup.py | 12 ++++++------ testsuite/setup.cfg => setup.cfg | 0 testsuite/datmantests/test_postgres_helper.py | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) rename testsuite/setup.cfg => setup.cfg (100%) diff --git a/datman-helper-postgres/datman_helper_postgres/backup.py b/datman-helper-postgres/datman_helper_postgres/backup.py index 0ff9f55..2aae7ef 100644 --- a/datman-helper-postgres/datman_helper_postgres/backup.py +++ b/datman-helper-postgres/datman_helper_postgres/backup.py @@ -3,7 +3,6 @@ import os import pwd import subprocess import sys -from subprocess import PIPE def cli(): @@ -14,10 +13,11 @@ def cli(): database: str — the name of the database to back up. user: optional str — the name of the Linux user to use to connect to Postgres. - Sudo or SSH will be used to make this happen, if it's specified. + Sudo or SSH will be used to make this happen, if it's specified, + unless it's a local user that is already the current user. - host: optional str — if specified, the backup will be made using SSH (unless this host is the same as the one - named) + host: optional str — if specified, the backup will be made using SSH + (unless this host is the same as the one named) """ request_info = json.load(sys.stdin) assert isinstance(request_info, dict) @@ -68,8 +68,8 @@ def cli(): ) output_of_dump = lz4_process.stdin - # we MUST disable shell here otherwise the local side will do both the compression and decompression which would be - # silly! + # we MUST disable shell here otherwise the local side will do both + # the compression and decompression which would be silly! subprocess.check_call( command, stdin=subprocess.DEVNULL, diff --git a/testsuite/setup.cfg b/setup.cfg similarity index 100% rename from testsuite/setup.cfg rename to setup.cfg diff --git a/testsuite/datmantests/test_postgres_helper.py b/testsuite/datmantests/test_postgres_helper.py index a550833..1117805 100644 --- a/testsuite/datmantests/test_postgres_helper.py +++ b/testsuite/datmantests/test_postgres_helper.py @@ -9,7 +9,8 @@ class TestPostgresHelper(TestCase): if "TEST_POSTGRES" not in os.environ: self.skipTest( "TEST_POSTGRES environment variable not set. " - "Should be set to a Postgres host, database, user combination, comma-separated." + "Should be set to a Postgres host, database," + " user combination, comma-separated." ) def test_helper_fails_on_bad_connection(self):