mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-11-04 00:02:37 +01:00 
			
		
		
		
	CLOUDSTACK-10252: Delete dnsmasq leases file on restart (#2427)
Delete dnsmasq's leases file when dnsmasq is restarted to avoid it use old ip-mac-address-vm mapping leases. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
		
							parent
							
								
									f80f00ebcb
								
							
						
					
					
						commit
						61a5a29705
					
				@ -49,15 +49,21 @@ class CsDhcp(CsDataBag):
 | 
			
		||||
            self.add(self.dbag[item])
 | 
			
		||||
        self.write_hosts()
 | 
			
		||||
 | 
			
		||||
        if self.cloud.is_changed():
 | 
			
		||||
            self.delete_leases()
 | 
			
		||||
 | 
			
		||||
        self.configure_server()
 | 
			
		||||
 | 
			
		||||
        restart_dnsmasq = self.conf.commit()
 | 
			
		||||
        self.cloud.commit()
 | 
			
		||||
        restart_dnsmasq = False
 | 
			
		||||
 | 
			
		||||
        if self.conf.commit():
 | 
			
		||||
            restart_dnsmasq = True
 | 
			
		||||
 | 
			
		||||
        if self.cloud.commit():
 | 
			
		||||
            restart_dnsmasq = True
 | 
			
		||||
 | 
			
		||||
        self.dhcp_opts.commit()
 | 
			
		||||
 | 
			
		||||
        if restart_dnsmasq:
 | 
			
		||||
            self.delete_leases()
 | 
			
		||||
 | 
			
		||||
        if not self.cl.is_redundant() or self.cl.is_master():
 | 
			
		||||
            if restart_dnsmasq:
 | 
			
		||||
                CsHelper.service("dnsmasq", "restart")
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user