@@ -92,16 +92,36 @@ def _check_tentacles_install_exit():
9292 sys .exit (0 )
9393
9494
95- async def update_or_repair_tentacles_if_necessary (tentacles_setup_config , config ):
96- if not tentacles_manager_api .are_tentacles_up_to_date (tentacles_setup_config , constants .VERSION ):
97- logging .get_logger (COMMANDS_LOGGER_NAME ).info ("OctoBot tentacles are not up to date. Updating tentacles..." )
95+ def _get_first_non_imported_profile_tentacles_setup_config (config ):
96+ return tentacles_manager_api .get_tentacles_setup_config (
97+ config .get_non_imported_profiles ()[0 ].get_tentacles_config_path ()
98+ )
99+
100+
101+ async def update_or_repair_tentacles_if_necessary (selected_profile_tentacles_setup_config , config ):
102+ local_profile_tentacles_setup_config = selected_profile_tentacles_setup_config
103+ logger = logging .get_logger (COMMANDS_LOGGER_NAME )
104+ if config .profile .imported :
105+ if not tentacles_manager_api .are_tentacles_up_to_date (selected_profile_tentacles_setup_config ,
106+ constants .VERSION ):
107+ selected_profile_tentacles_version = tentacles_manager_api .get_tentacles_installation_version (
108+ selected_profile_tentacles_setup_config
109+ )
110+ logger .warning (f"Current imported profile \" { config .profile .name } \" references tentacles in a different "
111+ f"version from the current OctoBot. Referenced version: "
112+ f"{ selected_profile_tentacles_version } , current OctoBot version: { constants .VERSION } . "
113+ f"This profile might not work properly." )
114+ # only update tentacles based on local (non imported) profiles tentacles installation version
115+ local_profile_tentacles_setup_config = _get_first_non_imported_profile_tentacles_setup_config (config )
116+ if not tentacles_manager_api .are_tentacles_up_to_date (local_profile_tentacles_setup_config , constants .VERSION ):
117+ logger .info ("OctoBot tentacles are not up to date. Updating tentacles..." )
98118 _check_tentacles_install_exit ()
99119 if await install_or_update_tentacles (config ):
100- logging . get_logger ( COMMANDS_LOGGER_NAME ) .info ("OctoBot tentacles are now up to date." )
120+ logger .info ("OctoBot tentacles are now up to date." )
101121 elif tentacles_manager_api .load_tentacles (verbose = True ):
102- logging . get_logger ( COMMANDS_LOGGER_NAME ) .debug ("OctoBot tentacles are up to date." )
122+ logger .debug ("OctoBot tentacles are up to date." )
103123 else :
104- logging . get_logger ( COMMANDS_LOGGER_NAME ) .info ("OctoBot tentacles are damaged. Installing default tentacles ..." )
124+ logger .info ("OctoBot tentacles are damaged. Installing default tentacles ..." )
105125 _check_tentacles_install_exit ()
106126 await install_or_update_tentacles (config )
107127
0 commit comments