Passed
Pull Request — master (#144)
by macartur
01:35
created

ControllerAPI   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A start() 0 4 1
A restart() 0 4 1
A status() 0 4 1
A stop() 0 4 1
1
"""Translate cli commands to non-cli code."""
2
import subprocess
3
4
5
class ControllerAPI:
6
    """Handle KytosController comamnds."""
7
8
    @staticmethod
9
    def start():
10
        """Start KytosController."""
11
        subprocess.run(["kytosd"])
12
13
    @staticmethod
14
    def status():
15
        """Display KytosController status."""
16
        subprocess.run(["kytosd", 'status'])
17
18
    @staticmethod
19
    def stop():
20
        """Start KytosController."""
21
        subprocess.run(["kytosd", 'stop'])
22
23
    @staticmethod
24
    def restart():
25
        """Start KytosController."""
26
        subprocess.run(["kytosd", 'restart'])
27