def run_install_gn_module(app, module_path, module_name, url): ''' Installation du module en executant : configurations install_env.sh installation des dépendances python install_db.py install_app.py ''' # configs try: from conf_schema_toml import GnModuleSchemaConf load_and_validate_toml( Path(module_path) / "config/conf_gn_module.toml", GnModuleSchemaConf) except ImportError: log.info('No specific config file') pass # requirements gn_module_import_requirements(module_path) # ENV gn_file = Path(module_path) / "install_env.sh" log.info("run install_env.sh") try: subprocess.call([str(gn_file)], cwd=str(module_path)) log.info("...%s\n", MSG_OK) except FileNotFoundError: pass except OSError as ex: if ex.errno == 8: raise GNModuleInstallError( ("Unable to execute '{}'. One possible reason is " "the lack of shebang line.").format(gn_file)) if os.access(str(gn_file), os.X_OK): # TODO: try to make it executable # TODO: change exception type # TODO: make error message # TODO: change print to log raise GNModuleInstallError("File {} not excecutable".format( str(gn_file))) # APP gn_file = Path(module_path) / "install_gn_module.py" if gn_file.is_file(): log.info("run install_gn_module.py") from install_gn_module import gnmodule_install_app gnmodule_install_app(DB, app) log.info("...%s\n", MSG_OK)
def run_install_gn_module(app, module_path): """ Installation du module en executant : configurations install_env.sh installation des dépendances python install_db.py install_app.py """ gn_module_import_requirements(module_path) # ENV gn_file = Path(module_path) / "install_env.sh" log.info("run install_env.sh") try: subprocess.call([str(gn_file)], cwd=str(module_path)) log.info("...%s\n", MSG_OK) except FileNotFoundError: pass except OSError as ex: if ex.errno == 8: raise GNModuleInstallError( ( "Unable to execute '{}'. One possible reason is " "the lack of shebang line." ).format(gn_file) ) if os.access(str(gn_file), os.X_OK): # TODO: try to make it executable # TODO: change exception type # TODO: make error message raise GNModuleInstallError("File {} not excecutable".format(str(gn_file))) # APP gn_file = Path(module_path) / "install_gn_module.py" if gn_file.is_file(): log.info("run install_gn_module.py") from install_gn_module import gnmodule_install_app gnmodule_install_app(DB, app) log.info("...%s\n", MSG_OK)
def run_install_gn_module(app, module_path): """ Installation du module en executant : configurations install_env.sh installation des dépendances python install_db.py install_app.py """ gn_module_import_requirements(module_path) # ENV gn_file = Path(module_path) / "install_env.sh" log.info("run install_env.sh") try: subprocess.call([str(gn_file)], cwd=str(module_path)) log.info("...%s\n", MSG_OK) except FileNotFoundError: pass except OSError as ex: if ex.errno == 8: raise GNModuleInstallError( ("Unable to execute '{}'. One possible reason is " "the lack of shebang line.").format(gn_file)) if os.access(str(gn_file), os.X_OK): # TODO: try to make it executable # TODO: change exception type # TODO: make error message raise GNModuleInstallError("File {} not excecutable".format( str(gn_file))) # APP gn_file = Path(module_path) / "install_gn_module.py" if gn_file.is_file(): log.info("run install_gn_module.py") from install_gn_module import gnmodule_install_app gnmodule_install_app(DB, app) log.info("...%s\n", MSG_OK)