Total Complexity | 1 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from backuppc_clone.DataLayer import DataLayer |
||
2 | from backuppc_clone.command.BaseCommand import BaseCommand |
||
3 | from backuppc_clone.helper.HostDelete import HostDelete |
||
4 | |||
5 | |||
6 | class HostDeleteCommand(BaseCommand): |
||
7 | """ |
||
8 | Deletes all backups and metadata of a host |
||
9 | |||
10 | host-delete |
||
11 | {clone.cfg : The configuration file of the clone} |
||
12 | {host : The name of the host} |
||
13 | """ |
||
14 | |||
15 | # ------------------------------------------------------------------------------------------------------------------ |
||
16 | def _handle_command(self) -> None: |
||
17 | """ |
||
18 | Executes the command. |
||
19 | """ |
||
20 | host = self.argument('host') |
||
21 | |||
22 | self._io.title('Deleting Host {}'.format(host)) |
||
23 | |||
24 | helper = HostDelete(self._io) |
||
25 | helper.delete_host(host) |
||
26 | |||
27 | DataLayer.instance.commit() |
||
28 | |||
30 |