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

ControllerAPI.start()   A

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 4
rs 10
1
"""Translate cli commands to non-cli code."""
2
import subprocess
3
4
5
class ControllerAPI:
6
    """Handle KytosController in daemon context."""
7
8
    @staticmethod
9
    def start():
10
        """Start Kytos in daemon context."""
11
        subprocess.run(["kytosd"])
12
13
    @staticmethod
14
    def stop():
15
        """Start Kytos in daemon context."""
16
        subprocess.run(["kytosd", 'stop'])
17
18
    @staticmethod
19
    def restart():
20
        """Start Kytos in daemon context."""
21
        subprocess.run(["kytosd", 'restart'])
22