Beispiel #1
0
 def _start_pub_px_proc(self):
     '''
     '''
     px = NapalmLogsPublisherProxy(self.opts['hwm'])
     proc = Process(target=px.start)
     proc.start()
     proc.description = 'Publisher proxy process'
     log.debug('Started pub proxy as %s with PID %s', proc._name, proc.pid)
     return proc
Beispiel #2
0
 def _start_dev_proc(self, device_os, device_config):
     '''
     Start the device worker process.
     '''
     log.info('Starting the child process for %s', device_os)
     dos = NapalmLogsDeviceProc(device_os, self.opts, device_config)
     os_proc = Process(target=dos.start)
     os_proc.start()
     os_proc.description = '%s device process' % device_os
     log.debug('Started process %s for %s, having PID %s', os_proc._name,
               device_os, os_proc.pid)
     return os_proc
Beispiel #3
0
 def _start_srv_proc(self, started_os_proc):
     '''
     Start the server process.
     '''
     log.debug('Starting the server process')
     server = NapalmLogsServerProc(self.opts, self.config_dict,
                                   started_os_proc)
     proc = Process(target=server.start)
     proc.start()
     proc.description = 'Server process'
     log.debug('Started server process as %s with PID %s', proc._name,
               proc.pid)
     return proc
Beispiel #4
0
 def _start_lst_proc(self, listener_type, listener_opts):
     '''
     Start the listener process.
     '''
     log.debug('Starting the listener process for %s', listener_type)
     listener = NapalmLogsListenerProc(self.opts,
                                       self.address,
                                       self.port,
                                       listener_type,
                                       listener_opts=listener_opts)
     proc = Process(target=listener.start)
     proc.start()
     proc.description = 'Listener process'
     log.debug('Started listener process as %s with PID %s', proc._name,
               proc.pid)
     return proc
Beispiel #5
0
 def _start_auth_proc(self):
     '''
     Start the authenticator process.
     '''
     log.debug('Computing the signing key hex')
     verify_key = self.__signing_key.verify_key
     sgn_verify_hex = verify_key.encode(encoder=nacl.encoding.HexEncoder)
     log.debug('Starting the authenticator subprocess')
     auth = NapalmLogsAuthProc(self.certificate, self.keyfile,
                               self.__priv_key, sgn_verify_hex,
                               self.auth_address, self.auth_port)
     proc = Process(target=auth.start)
     proc.start()
     proc.description = 'Auth process'
     log.debug('Started auth process as %s with PID %s', proc._name,
               proc.pid)
     return proc
Beispiel #6
0
 def _start_lst_proc(self):
     # pipe):
     '''
     Start the listener process.
     '''
     log.debug('Starting the listener process')
     # Get the correct listener class
     listener = NapalmLogsListenerProc(
         self.opts,
         self.address,
         self.port,
         self.listener_type,
         # pipe,
         listener_opts=self.listener_opts)
     proc = Process(target=listener.start)
     proc.start()
     proc.description = 'Listener process'
     log.debug('Started listener process as %s with PID %s', proc._name,
               proc.pid)
     return proc
Beispiel #7
0
 def _start_pub_proc(self, publisher_type, publisher_opts, pub_id):
     '''
     Start the publisher process.
     '''
     log.debug('Starting the publisher process for %s', publisher_type)
     publisher = NapalmLogsPublisherProc(
         self.opts,
         self.publish_address,
         self.publish_port,
         publisher_type,
         self.serializer,
         self.__priv_key,
         self.__signing_key,
         publisher_opts,
         disable_security=self.disable_security,
         pub_id=pub_id)
     proc = Process(target=publisher.start)
     proc.start()
     proc.description = 'Publisher process'
     log.debug('Started publisher process as %s with PID %s', proc._name,
               proc.pid)
     return proc
Beispiel #8
0
 def _start_pub_proc(self):
     # pub_pipe):
     '''
     Start the publisher process.
     '''
     log.info('Starting the publisher process')
     publisher = NapalmLogsPublisherProc(
         self.opts,
         self.publish_address,
         self.publish_port,
         self.transport,
         # pub_pipe,
         self.__priv_key,
         self.__signing_key,
         self.publisher_opts,
         disable_security=self.disable_security)
     proc = Process(target=publisher.start)
     proc.start()
     proc.description = 'Publisher process'
     log.debug('Started publisher process as %s with PID %s', proc._name,
               proc.pid)
     return proc