1 | from backuppc_clone.DataLayer import DataLayer |
||
2 | from backuppc_clone.command.BaseCommand import BaseCommand |
||
3 | from backuppc_clone.helper.BackupClone import BackupClone |
||
4 | |||
5 | |||
6 | View Code Duplication | class BackupCloneCommand(BaseCommand): |
|
0 ignored issues
–
show
Duplication
introduced
by
![]() |
|||
7 | """ |
||
8 | Clones a single host backup |
||
9 | |||
10 | backup-clone |
||
11 | {clone.cfg : The configuration file of the clone} |
||
12 | {host : The name of the host} |
||
13 | {backup# : The backup number} |
||
14 | """ |
||
15 | |||
16 | # ------------------------------------------------------------------------------------------------------------------ |
||
17 | def _handle_command(self) -> None: |
||
18 | """ |
||
19 | Executes the command. |
||
20 | """ |
||
21 | host = self.argument('host') |
||
22 | backup_no = int(self.argument('backup#')) |
||
23 | |||
24 | self._io.title('Cloning Backup {}/{}'.format(host, backup_no)) |
||
25 | |||
26 | helper = BackupClone(self._io) |
||
27 | helper.clone_backup(host, backup_no) |
||
28 | |||
29 | DataLayer.instance.commit() |
||
30 | |||
31 | # ---------------------------------------------------------------------------------------------------------------------- |
||
32 |