PoolCommand._handle_command()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nop 1
dl 0
loc 10
rs 10
c 0
b 0
f 0
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