backuppc_clone.command.PoolCommand   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A PoolCommand._handle_command() 0 10 1
1
from backuppc_clone.DataLayer import DataLayer
2
from backuppc_clone.command.BaseCommand import BaseCommand
3
from backuppc_clone.helper.PoolSync import PoolSync
4
5
6
class PoolCommand(BaseCommand):
7
    """
8
    Inventories the original pool, prunes the clone pool and maintains the database
9
10
    pool
11
        {clone.cfg : The configuration file of the clone}
12
    """
13
14
    # ------------------------------------------------------------------------------------------------------------------
15
    def _handle_command(self) -> None:
16
        """
17
        Executes the command.
18
        """
19
        self._io.title('Maintaining Clone Pool and Pool Metadata')
20
21
        helper = PoolSync(self._io)
22
        helper.synchronize()
23
24
        DataLayer.instance.commit()
25
26
# ----------------------------------------------------------------------------------------------------------------------
27