def tearDownClass(cls):
     default_network_config_file = simulaqron_settings._default_config[
         "network_config_file"]
     network_config = NetworksConfigConstructor(default_network_config_file)
     network_config.reset()
     network_config.write_to_file()
     simulaqron_settings.default_settings()
import simulaqron
from simulaqron.network import Network
from simulaqron.settings import simulaqron_settings
from simulaqron.toolbox.manage_nodes import NetworksConfigConstructor
from simulaqron.toolbox.reset import main as reset_simulaqron

CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
PID_FOLDER = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                          ".simulaqron_pids")

# Check that the default network_config_file exists
default_network_config_file = simulaqron_settings._default_config[
    "network_config_file"]
if not os.path.exists(default_network_config_file):
    networks_config = NetworksConfigConstructor()
    networks_config.reset()
    networks_config.write_to_file(default_network_config_file)


class SimulaQronDaemon(run.RunDaemon):
    def __init__(self,
                 pidfile,
                 name=None,
                 nrnodes=None,
                 nodes=None,
                 topology=None,
                 new=True):
        super().__init__(pidfile=pidfile)
        self.name = name
        self.nrnodes = nrnodes
        self.nodes = nodes
Exemple #3
0
def _create_default_network_config():
    networks_config = NetworksConfigConstructor()
    networks_config.reset()
    networks_config.write_to_file(simulaqron_settings.network_config_file)
Exemple #4
0
def main():
    simulaqron_settings.default_settings()
    networks_config = NetworksConfigConstructor()
    networks_config.reset()
    networks_config.write_to_file(simulaqron_settings.network_config_file)