diff --git a/Snap-Tool/modules/FormClass.py b/Snap-Tool/modules/FormClass.py index a263da6..128f82c 100644 --- a/Snap-Tool/modules/FormClass.py +++ b/Snap-Tool/modules/FormClass.py @@ -421,7 +421,7 @@ def deleteRepository(self): else: snap_tool_conf = self.utils.readYamlFile(self.configuration.conf_file, 'r') list_all_repositories = self.utils.convertListToCheckOrRadioList(list_aux_repositories, "Repository Name") - opt_repos = self.getDataCheckList("Select a option:", list_all_repositories, "Repositories") + opt_repos = self.getDataCheckList("Select one or more options:", list_all_repositories, "Repositories") confirm_delete_repos = self.getDataYesOrNo("\nAre you sure to delete the following repository(s)?", "Delete repositories") if confirm_delete_repos == "ok": message_to_display = "\nDeleted repositories:\n\n" @@ -536,7 +536,7 @@ def deleteSnapshot(self): if delete_snapshot == "ok": for snapshot in opt_snapshots: self.elastic.deleteSnapshotElastic(conn_es, opt_repo, snapshot) - message_delete_snapshot = self.telegram.getMessageDeleteSnapshot(snapshot) + message_delete_snapshot = self.telegram.getMessageDeleteSnapshot(snapshot, opt_repo) self.telegram.sendTelegramAlert(self.utils.decryptAES(snap_tool_conf['telegram_chat_id']).decode('utf-8'), self.utils.decryptAES(snap_tool_conf['telegram_bot_token']).decode('utf-8'), message_delete_snapshot) message = "\nThe following snapshots were removed:\n\n" message += self.utils.convertListToString(opt_snapshots) @@ -732,7 +732,7 @@ def switchRmenu(self, option): if option == 1: self.createRepository() elif option == 2: - self.deleteSnapshot() + self.deleteRepository() """ Method that launches an action based on the option chosen in the Snapshots menu. diff --git a/Snap-Tool/modules/TelegramClass.py b/Snap-Tool/modules/TelegramClass.py index 3cb5956..ccf3543 100644 --- a/Snap-Tool/modules/TelegramClass.py +++ b/Snap-Tool/modules/TelegramClass.py @@ -83,7 +83,7 @@ def getMessageCreateRepository(self, repository_name, path_repository, compress_ message += u'\u2611\uFE0F' + " Action: Repository created\n" message += u'\u2611\uFE0F' + " Repository name: " + repository_name + '\n' message += u'\u2611\uFE0F' + " Repository path: " + path_repository + '\n' - message += u'\u2611\uFE0F' + " Repository compression: " + compress_repository + message += u'\u2611\uFE0F' + " Repository compression: " + str(compress_repository) return message """ @@ -108,15 +108,16 @@ def getMessageDeleteRepository(self, repository_name): Parameters: self -- An instantiated object of the Telegram class. snapshot_name -- Name of the deleted snapshot. + repository_name -- Name of the repository where the snapshot was hosted. Return: message -- Message to send. """ - def getMessageDeleteSnapshot(self, snapshot_name): + def getMessageDeleteSnapshot(self, snapshot_name, repository_name): message = self.getHeaderMessage() message += u'\u2611\uFE0F' + " Action: Snaphot removed\n" message += u'\u2611\uFE0F' + " Snapshot name: " + snapshot_name + '\n' - message += u'\u2611\uFE0F' + " Index name: " + snapshot_name + message += u'\u2611\uFE0F' + " Repository name: " + repository_name return message """