62db99d1d1
Removes stale DHCP and L3 namespaces. The cron runs once in 12 hours. Network namespace cleanup is implemented as a daemonset as Kubernetes does not have a cronjob that works like daemonset-cronjob. Network namespace cleanup should run on all nodes where DHCP and L3 agents run. Change-Id: I7525e493067669026e0d57889a3e3238a2bd1308
25 lines
575 B
Smarty
25 lines
575 B
Smarty
#!/usr/bin/env python
|
|
|
|
import sys
|
|
import time
|
|
|
|
from oslo_config import cfg
|
|
|
|
from neutron.cmd.netns_cleanup import main
|
|
|
|
if __name__ == "__main__":
|
|
while True:
|
|
try:
|
|
main()
|
|
# Sleep for 12 hours
|
|
time.sleep(43200)
|
|
except Exception as ex:
|
|
sys.stderr.write(
|
|
"Cleaning network namespaces caught an exception %s"
|
|
% str(ex))
|
|
except:
|
|
sys.stderr.write(
|
|
"Cleaning network namespaces caught an exception")
|
|
finally:
|
|
cfg.CONF.clear()
|