From 1cbeae261e2c741f8d7e2f5660f6ba279bb111dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Moreira?= Date: Mon, 2 Mar 2020 11:31:00 -0300 Subject: [PATCH] [web][uninstall] removing fix javascript file associated with the application --- bauh/gems/web/controller.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bauh/gems/web/controller.py b/bauh/gems/web/controller.py index 88ce8c56..cf7b1c91 100644 --- a/bauh/gems/web/controller.py +++ b/bauh/gems/web/controller.py @@ -353,6 +353,20 @@ class WebApplicationManager(SoftwareManager): type_=MessageType.WARNING) traceback.print_exc() + self.logger.info("Checking if there is any Javascript fix file associated with {} ".format(pkg.name)) + + fix_path = '{}/{}.js'.format(FIXES_PATH, pkg.id) + + if os.path.isfile(fix_path): + self.logger.info("Removing fix file '{}'".format(fix_path)) + try: + os.remove(fix_path) + except: + self.logger.error("Could not remove fix file '{}'".format(fix_path)) + traceback.print_exc() + watcher.show_message(title=self.i18n['error'], + body=self.i18n['web.uninstall.error.remove'].format(bold(fix_path)), + type_=MessageType.WARNING) return True def get_managed_types(self) -> Set[Type[SoftwarePackage]]: