Skip to content

Commit

Permalink
latest
Browse files Browse the repository at this point in the history
  • Loading branch information
“Erick committed Oct 28, 2021
1 parent ca49910 commit ba0633f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Snap-Tool/modules/FormClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions Snap-Tool/modules/TelegramClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

"""
Expand All @@ -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

"""
Expand Down

0 comments on commit ba0633f

Please sign in to comment.