Module: check_mk
Branch: master
Commit: 076943453c3e84bb919bea67559bb9d9fc18e6df
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=076943453c3e84…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 26 18:11:27 2016 +0200
backup restore: some cleanups
---
web/htdocs/backup.py | 10 ++++++----
web/htdocs/images/icon_backup_restore_complete.png | Bin 0 -> 2217 bytes
web/htdocs/wato.py | 10 ++++++++--
3 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/web/htdocs/backup.py b/web/htdocs/backup.py
index 124d8a6..fbbf0f7 100644
--- a/web/htdocs/backup.py
+++ b/web/htdocs/backup.py
@@ -1578,13 +1578,13 @@ class PageBackupRestore(object):
self._target_ident = ident
try:
- self._get_target(self._target_ident)
+ self._target = self._get_target(self._target_ident)
except KeyError:
raise MKUserError("target_p_target", _("This backup target
does not exist."))
def _get_target(self, target_ident):
- raise NotImplementedError()
+ return self.targets().get(target_ident)
def title(self):
@@ -1763,10 +1763,12 @@ class PageBackupRestore(object):
self._show_backup_list()
else:
+ self._show_target_list()
+
+
+ def _show_target_list(self):
html.p(_("Please choose a target to perform the restore from."))
self.targets().show_list()
- SystemBackupTargetsReadOnly().show_list(editable=False,
- title=_("System global
targets"))
def _show_backup_list(self):
diff --git a/web/htdocs/images/icon_backup_restore_complete.png
b/web/htdocs/images/icon_backup_restore_complete.png
new file mode 100644
index 0000000..328493e
Binary files /dev/null and b/web/htdocs/images/icon_backup_restore_complete.png differ
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index c90f1c6..1d41c8c 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5474,9 +5474,15 @@ class ModeBackupRestore(backup.PageBackupRestore, WatoMode):
def _get_target(self, target_ident):
try:
- self._target = self.targets().get(target_ident)
+ return self.targets().get(target_ident)
except KeyError:
- self._target = backup.SystemBackupTargetsReadOnly().get(target_ident)
+ return backup.SystemBackupTargetsReadOnly().get(target_ident)
+
+
+ def _show_target_list(self):
+ super(ModeBackupRestore, self)._show_target_list()
+ backup.SystemBackupTargetsReadOnly().show_list(
+ editable=False, title=_("System global
targets"))
def _show_backup_list(self):