Esempio n. 1
0
    def _validate_target(self, value, varprefix):
        targets = self.targets()
        try:
            targets.get(value)
        except KeyError:
            backup.SystemBackupTargetsReadOnly().validate_target(value, varprefix)
            return

        targets.validate_target(value, varprefix)
Esempio n. 2
0
    def backup_target_choices(self):
        choices = self.targets().choices()

        # Only add system wide defined targets that don't conflict with
        # the site specific backup targets
        choice_dict = dict(choices)
        for key, title in backup.SystemBackupTargetsReadOnly().choices():
            if key not in choice_dict:
                choices.append((key, _("%s (system wide)") % title))

        return sorted(choices, key=lambda x_y: x_y[1].title())
Esempio n. 3
0
 def page(self):
     self.targets().show_list()
     backup.SystemBackupTargetsReadOnly().show_list(
         editable=False, title=_("System global targets"))
Esempio n. 4
0
 def _show_target_list(self) -> None:
     super()._show_target_list()
     backup.SystemBackupTargetsReadOnly().show_list(
         editable=False, title=_("System global targets"))
Esempio n. 5
0
 def _get_target(self, target_ident):
     try:
         return self.targets().get(target_ident)
     except KeyError:
         return backup.SystemBackupTargetsReadOnly().get(target_ident)
Esempio n. 6
0
 def _show_target_list(self):
     # type: () -> None
     super(ModeBackupRestore, self)._show_target_list()
     backup.SystemBackupTargetsReadOnly().show_list(editable=False,
                                                    title=_("System global targets"))