From 7bd3e075a85c427e6a8310f478bbcbbad67ea55e Mon Sep 17 00:00:00 2001 From: Xieyt Date: Fri, 10 May 2024 18:54:19 +0530 Subject: [PATCH 1/3] fix: fm code force start flag double start of bench --- frappe_manager/site_manager/site.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/frappe_manager/site_manager/site.py b/frappe_manager/site_manager/site.py index a7341e5f..faf812d1 100644 --- a/frappe_manager/site_manager/site.py +++ b/frappe_manager/site_manager/site.py @@ -17,7 +17,6 @@ from frappe_manager.migration_manager.backup_manager import BackupManager from frappe_manager.services_manager.services import ServicesManager from frappe_manager.site_manager import VSCODE_LAUNCH_JSON, VSCODE_SETTINGS_JSON, VSCODE_TASKS_JSON -from frappe_manager.site_manager import bench_config from frappe_manager.site_manager.admin_tools import AdminTools from frappe_manager.site_manager.bench_config import BenchConfig, FMBenchEnvType from frappe_manager.site_manager.site_exceptions import ( @@ -415,6 +414,7 @@ def start(self, force: bool = False): self.sync_bench_common_site_config(global_db_info.host, global_db_info.port) richprint.change_head("Starting bench services") + self.admin_tools.remove_nginx_location_config() self.compose_project.start_service(force_recreate=force) self.sync_bench_config_configuration() self.save_bench_config() @@ -426,12 +426,6 @@ def start(self, force: bool = False): self.workers.compose_project.start_service(force_recreate=force) richprint.print("Started bench workers services.") - # # start admin_tools if exists - # if self.admin_tools.compose_project.compose_file_manager.exists(): - # richprint.change_head("Starting bench admin tools services") - # self.admin_tools.compose_project.start_service(force_recreate=force) - # richprint.print("Started bench admin tools services.") - richprint.change_head('Starting frappe server') self.frappe_logs_till_start() richprint.print('Started frappe server.') @@ -966,7 +960,7 @@ def attach_to_bench(self, user: str, extensions: List[str], workdir: str, debugg self.compose_project.compose_file_manager.set_labels("frappe", labels) self.compose_project.compose_file_manager.write_to_file() richprint.print(f"Regenerated bench compose.") - self.start() + self.compose_project.start_service(['frappe']) # sync debugger files if debugger: From 0b035a14079dcb235932e91214009acfbb16f466 Mon Sep 17 00:00:00 2001 From: Xieyt Date: Fri, 10 May 2024 19:00:24 +0530 Subject: [PATCH 2/3] fix: create command template site creation --- frappe_manager/site_manager/site.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/frappe_manager/site_manager/site.py b/frappe_manager/site_manager/site.py index faf812d1..a2bd5c5a 100644 --- a/frappe_manager/site_manager/site.py +++ b/frappe_manager/site_manager/site.py @@ -192,7 +192,11 @@ def create(self, is_template_bench: bool = False): if is_template_bench: self.remove_attached_secrets() - richprint.exit(f"Created template bench: {self.name}", emoji_code=":white_check_mark:") + global_db_info = self.services.database_manager.database_server_info + self.sync_bench_common_site_config(global_db_info.host, global_db_info.port) + self.save_bench_config() + richprint.print(f"Created template bench: {self.name}", emoji_code=":white_check_mark:") + return richprint.change_head(f"Starting bench services") self.compose_project.start_service(force_recreate=True) @@ -219,20 +223,8 @@ def create(self, is_template_bench: bool = False): self.logger.info(f"{self.name}: Bench site is active and responding.") - # self.create_certificate() - - # richprint.change_head("Configuring bench admin tools.") - - # if self.bench_config.admin_tools: - # self.sync_admin_tools_compose() - # self.restart_frappe_server() - - # richprint.print("Cofigured bench admin tools.") - self.info() - # self.save_bench_config() - if not ".localhost" in self.name: richprint.print( f"Please note that You will have to add a host entry to your system's hosts file to access the bench locally." From f289135592ff39964c24bd467ddeea495d8c8adb Mon Sep 17 00:00:00 2001 From: Xieyt Date: Fri, 10 May 2024 19:06:58 +0530 Subject: [PATCH 3/3] chore: fix status msg --- frappe_manager/migration_manager/migration_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe_manager/migration_manager/migration_base.py b/frappe_manager/migration_manager/migration_base.py index a4fdf73d..e5d3adad 100644 --- a/frappe_manager/migration_manager/migration_base.py +++ b/frappe_manager/migration_manager/migration_base.py @@ -159,7 +159,7 @@ def bench_db_backup( bench_db_info = bench.get_db_connection_info() bench_db_name = bench_db_info["name"] - richprint.change_head(f'Commencing db [blue]{bench.name}[/blue] backup') + richprint.change_head(f'Commencing db {bench.name} backup') mariadb_manager = MariaDBManager(server_db_info, services_manager.compose_project)