[wip] Be able to readd a repo before postinstall

This commit is contained in:
ljf 2022-10-25 02:28:44 +02:00
parent 74d34b5d28
commit ffc0c8d22e
No known key found for this signature in database
3 changed files with 7 additions and 8 deletions

View file

@ -1377,9 +1377,7 @@ backup:
--keep-within: --keep-within:
help: Keep all archives within this time interval help: Keep all archives within this time interval
extra: extra:
pattern: &pattern_interval pattern: *pattern_interval
- !!str ^\d+[Hdw]$
- "pattern_interval"
### backup_timer_update() ### backup_timer_update()
update: update:
@ -1429,9 +1427,7 @@ backup:
--keep-within: --keep-within:
help: Keep all archives within this time interval help: Keep all archives within this time interval
extra: extra:
pattern: &pattern_interval pattern: *pattern_interval
- !!str ^\d+[Hdw]$
- "pattern_interval"
### backup_timer_remove() ### backup_timer_remove()
remove: remove:

View file

@ -76,6 +76,7 @@ def check_command_is_valid_before_postinstall(args):
"tools postinstall", "tools postinstall",
"tools versions", "tools versions",
"tools shell", "tools shell",
"backup repository",
"backup list", "backup list",
"backup restore", "backup restore",
"log display", "log display",

View file

@ -115,8 +115,10 @@ class BackupRepository(ConfigPanel):
return full_repositories return full_repositories
def __init__(self, entity, config_path=None, save_path=None, creation=False): def __init__(self, entity, config_path=None, save_path=None, creation=False):
if self.entity is None:
self.entity = settings_get("misc.backup.backup_default_repositories")[0] if entity is None:
entity = settings_get("misc.backup.backup_default_repositories")[0]
super().__init__(entity, config_path, save_path, creation) super().__init__(entity, config_path, save_path, creation)
self._load_current_values() self._load_current_values()