Пример #1
0
 def delete(self):
     """
     Delete this node and its associate resources
     """
     self.call('sysctl', '-w', 'net.ipv4.ip_forward=0')
     # Stop ospfd
     pid = read_pid(self.ospfd_pid)
     if pid:
         log.debug('Killing ospfd')
         self.call('kill', '-9', pid)
     del_file(self.ospf_cfg)
     del_file(self.ospfd_pid)
     # Stop zebra
     pid = read_pid(self.zebra_pid)
     if pid:
         log.debug('Killing zebra')
         self.call('kill', '-9', pid)
     del_file(self.zebra_cfg)
     del_file(self.zebra_pid)
     del_file(self.zebra_api)
Пример #2
0
def stopCounterCollectors(topo):
    """"""
    print("*** Stopping counterCollectors")

    for rid in topo.routers():
        # Stop counters process
        pid = read_pid("/tmp/load_{0}.pid".format(rid))

        if pid:
            subprocess.call(['kill', '-9', pid])

        # Erase load writen by the process
        del_file("/tmp/load_{0}.pid".format(rid))
        del_file("/tmp/load_{0}".format(rid))
        del_file("/tmp/load_{0}_tmp".format(rid))

        # Delete ifDescript file
        path = "/tmp/ifDescr_{0}".format(rid)
        del_file(path)
Пример #3
0
 def terminate(self, *args, **kwargs):
     force(self.process.terminate)
     del_file(self.socket_path)
     super(FibbingController, self).terminate(*args, **kwargs)