mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 03:53:50 +00:00 
			
		
		
		
	upgrade: Remove tsearch_extras cleanup code.
This code was originally added in 382261dc72 in Zulip Server 3.0;
since we can only directly upgrade from 5.0 or later, this code is
guaranteed to have run already. Remove it.
			
			
This commit is contained in:
		
				
					committed by
					
						 Tim Abbott
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							53bf48a873
						
					
				
				
					commit
					39cc830ae5
				
			| @@ -5,7 +5,6 @@ | |||||||
| # always run from the new version of Zulip, so any bug fixes take | # always run from the new version of Zulip, so any bug fixes take | ||||||
| # effect on the very next upgrade. | # effect on the very next upgrade. | ||||||
| import argparse | import argparse | ||||||
| import glob |  | ||||||
| import hashlib | import hashlib | ||||||
| import logging | import logging | ||||||
| import os | import os | ||||||
| @@ -29,7 +28,6 @@ from scripts.lib.zulip_tools import ( | |||||||
|     get_config, |     get_config, | ||||||
|     get_config_file, |     get_config_file, | ||||||
|     parse_version_from, |     parse_version_from, | ||||||
|     run_psql_as_postgres, |  | ||||||
|     start_arg_parser, |     start_arg_parser, | ||||||
|     su_to_zulip, |     su_to_zulip, | ||||||
| ) | ) | ||||||
| @@ -149,14 +147,6 @@ def shutdown_server(fill_caches: bool = True) -> None: | |||||||
|         IS_SERVER_UP = False |         IS_SERVER_UP = False | ||||||
|  |  | ||||||
|  |  | ||||||
| if glob.glob("/usr/share/postgresql/*/extension/tsearch_extras.control"): |  | ||||||
|     # Remove legacy tsearch_extras package references |  | ||||||
|     run_psql_as_postgres( |  | ||||||
|         config_file=config_file, |  | ||||||
|         sql_query="DROP EXTENSION IF EXISTS tsearch_extras;", |  | ||||||
|     ) |  | ||||||
|     subprocess.check_call(["apt-get", "remove", "-y", "postgresql-*-tsearch-extras"]) |  | ||||||
|  |  | ||||||
| if not (args.skip_restart or args.skip_puppet): | if not (args.skip_restart or args.skip_puppet): | ||||||
|     # We need to temporarily hold pgroonga, if installed -- upgrading |     # We need to temporarily hold pgroonga, if installed -- upgrading | ||||||
|     # it without running the appropriate upgrade SQL can cause |     # it without running the appropriate upgrade SQL can cause | ||||||
|   | |||||||
| @@ -626,15 +626,6 @@ def get_deploy_options(config_file: configparser.RawConfigParser) -> list[str]: | |||||||
|     return shlex.split(get_config(config_file, "deployment", "deploy_options", "")) |     return shlex.split(get_config(config_file, "deployment", "deploy_options", "")) | ||||||
|  |  | ||||||
|  |  | ||||||
| def run_psql_as_postgres( |  | ||||||
|     config_file: configparser.RawConfigParser, |  | ||||||
|     sql_query: str, |  | ||||||
| ) -> None: |  | ||||||
|     dbname = get_config(config_file, "postgresql", "database_name", "zulip") |  | ||||||
|     subcmd = shlex.join(["psql", "-v", "ON_ERROR_STOP=1", "-d", dbname, "-c", sql_query]) |  | ||||||
|     subprocess.check_call(["su", "postgres", "-c", subcmd]) |  | ||||||
|  |  | ||||||
|  |  | ||||||
| def get_tornado_ports(config_file: configparser.RawConfigParser) -> list[int]: | def get_tornado_ports(config_file: configparser.RawConfigParser) -> list[int]: | ||||||
|     ports = [] |     ports = [] | ||||||
|     if config_file.has_section("tornado_sharding"): |     if config_file.has_section("tornado_sharding"): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user