mirror of https://github.com/zulip/zulip.git
upgrade-zulip: Set postgresql.version from running version, not a guess.
This commit is contained in:
parent
6dc8f748ae
commit
b9210e3ed9
|
@ -208,17 +208,18 @@ def shutdown_server() -> None:
|
||||||
if os.path.exists("/etc/init.d/postgresql"):
|
if os.path.exists("/etc/init.d/postgresql"):
|
||||||
postgresql_version = get_config(config_file, "postgresql", "version")
|
postgresql_version = get_config(config_file, "postgresql", "version")
|
||||||
if not postgresql_version:
|
if not postgresql_version:
|
||||||
default_postgresql_version = {
|
postgresql_version = subprocess.check_output(
|
||||||
("debian", "11"): "13",
|
# We use the _current_ deploy's manage.py, since ours has not
|
||||||
("debian", "12"): "15",
|
# yet had its virtualenv configured yet.
|
||||||
("ubuntu", "20.04"): "12",
|
[
|
||||||
("ubuntu", "22.04"): "14",
|
"../current/manage.py",
|
||||||
("centos", "7"): "11",
|
"shell",
|
||||||
}
|
"-c",
|
||||||
if (vendor, os_version) in default_postgresql_version:
|
"from django.db import connection; print(int(connection.cursor().connection.server_version/10000))",
|
||||||
postgresql_version = default_postgresql_version[(vendor, os_version)]
|
],
|
||||||
else:
|
preexec_fn=su_to_zulip,
|
||||||
error_desupported_os(vendor, os_version)
|
text=True,
|
||||||
|
).strip()
|
||||||
subprocess.check_call(
|
subprocess.check_call(
|
||||||
[
|
[
|
||||||
"crudini",
|
"crudini",
|
||||||
|
|
Loading…
Reference in New Issue