Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

ruff: Fix PLW1510 `subprocess.run` without explicit `check` argument.

Anders Kaseorgc43629a222c2
diff --git a/puppet/zulip/files/nagios_plugins/zulip_postgresql_backups/check_postgresql_backup b/puppet/zulip/files/nagios_plugins/zulip_postgresql_backups/check_postgresql_backup
index 2f3e268b5f8..ead5f96d80a 100755
--- a/puppet/zulip/files/nagios_plugins/zulip_postgresql_backups/check_postgresql_backup
+++ b/puppet/zulip/files/nagios_plugins/zulip_postgresql_backups/check_postgresql_backup
@@ -41,6 +41,7 @@ skip_backups = subprocess.run(
["crudini", "--get", "/etc/zulip/zulip.conf", "postgresql", "skip_backups"],
capture_output=True,
text=True,
+ check=False,
)
if skip_backups.returncode == 0 and skip_backups.stdout.strip().lower() in [
1,
diff --git a/scripts/lib/upgrade-zulip-stage-2 b/scripts/lib/upgrade-zulip-stage-2
index dabe3a5cb20..b8393e39fc6 100755
--- a/scripts/lib/upgrade-zulip-stage-2
+++ b/scripts/lib/upgrade-zulip-stage-2
@@ -399,7 +399,9 @@ has_puppet_changes = True
if not args.skip_puppet and IS_SERVER_UP:
logging.info("Pre-checking for puppet changes...")
try_puppet = subprocess.run(
- ["./scripts/zulip-puppet-apply", "--noop", "--force"], stdout=subprocess.DEVNULL
+ ["./scripts/zulip-puppet-apply", "--noop", "--force"],
+ stdout=subprocess.DEVNULL,
+ check=False,
)
if try_puppet.returncode == 0:
if minimal_change:
diff --git a/scripts/restart-server b/scripts/restart-server
index 45a9e08f6e5..e36c643ba2b 100755
--- a/scripts/restart-server
+++ b/scripts/restart-server
@@ -185,6 +185,7 @@ if has_application_server():
uwsgi_status = subprocess.run(
["supervisorctl", "status", "zulip-django"],
stdout=subprocess.DEVNULL,
+ check=False,
)
if uwsgi_status.returncode == 0:
logging.info("Starting rolling restart of django server")
diff --git a/tools/lib/pretty_print.py b/tools/lib/pretty_print.py
index bb29bd5ac87..4c1db879821 100644
--- a/tools/lib/pretty_print.py
+++ b/tools/lib/pretty_print.py
@@ -180,7 +180,7 @@ Proposed {BOLDRED}diff{ENDC} for {CYAN}{fn}{ENDC}:
""",
flush=True,
)
- subprocess.run(["diff", fn, "-"], input=phtml, text=True)
+ subprocess.run(["diff", fn, "-"], input=phtml, text=True, check=False)
print(
f"""
---
diff --git a/zerver/tests/test_email_mirror.py b/zerver/tests/test_email_mirror.py
index 6b78fd57765..debd952cb1a 100644
--- a/zerver/tests/test_email_mirror.py
+++ b/zerver/tests/test_email_mirror.py
@@ -1493,6 +1493,7 @@ class TestScriptMTA(ZulipTestCase):
input=mail,
stdout=subprocess.PIPE,
text=True,
+ check=False,
)
self.assertEqual(
p.stdout,