mirror of
https://github.com/natankeddem/bale.git
synced 2026-05-03 14:12:54 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 61f297aa0b | |||
| 425b607e8c |
+11
-5
@@ -268,8 +268,15 @@ class Automation(Tab):
|
||||
rows = await self._grid.get_selected_rows()
|
||||
for row in rows:
|
||||
for job in self.scheduler.scheduler.get_jobs():
|
||||
j = job.id.split("@")[0]
|
||||
if j == row["name"]:
|
||||
auto = automation(job)
|
||||
if auto is not None and auto.name == row["name"]:
|
||||
if job.id in job_handlers:
|
||||
del job_handlers[job.id]
|
||||
if isinstance(auto, scheduler.Zfs_Autobackup):
|
||||
for host in auto.hosts:
|
||||
command = AutomationTemplate(auto.prop)
|
||||
prop = command.safe_substitute(name=auto.name, host=host)
|
||||
await self._remove_prop_from_all_fs(host=host, prop=prop)
|
||||
self.scheduler.scheduler.remove_job(job.id)
|
||||
self._automations.remove(row)
|
||||
self._grid.update()
|
||||
@@ -767,7 +774,6 @@ class Automation(Tab):
|
||||
self.scheduler.scheduler.remove_job(job.id)
|
||||
for host in hosts:
|
||||
auto_id = f"{auto_name}@{host}"
|
||||
|
||||
if self.previous_prop != "":
|
||||
command = AutomationTemplate(self.previous_prop)
|
||||
prop = command.safe_substitute(name=auto_name, host=host)
|
||||
@@ -810,8 +816,8 @@ class Automation(Tab):
|
||||
)
|
||||
elif self.app.value == "remote":
|
||||
for job in jobs:
|
||||
j = job.id.split("@")[0]
|
||||
if j == auto_name:
|
||||
auto = automation(job)
|
||||
if auto is not None and auto.name == auto_name:
|
||||
self.scheduler.scheduler.remove_job(job.id)
|
||||
for host in hosts:
|
||||
auto_id = f"{auto_name}@{host}"
|
||||
|
||||
Reference in New Issue
Block a user