def started(self, component): self.load_configuration() config = self.choice_config() if not config: return self.install_modules(config) Log.debug('install sucessfull') shutil.rmtree(os.path.join(MODULES_PATH, 'install')) Daemon.restart()
class SelectedSession(Cli): def __init__(self, sid): self.session = Daemon().get_session(sid) def do_help(self, *args): print('\n'.join(( 'Usage: {0} session {1} OBJECT', ' session {1} help This help', ' session {1} state <state> Set the state of this session', ' session {1} node Manipulate nodes of this session', ' session {1} link <nid> <nid_a> <ifid_a> Link two nodes together', )).format(sys.argv[0], self.session.sid)) def do_node(self, *args): return Node(self.session).run(*args) def do_link(self, nid, nid_a, ifid_a): self.session.link(nid, nid_a, ifid_a) def do_state(self, state): self.session.state = state
#!/usr/bin/env python3 from core import Daemon Daemon.start()
def command_shutdown(self, send_handler, args, kwargs, client_key): send_handler('shutdown %s ...' % settings.NAME) Daemon.stop()
def __init__(self, sid): self.session = Daemon().get_session(sid)