and this
This commit is contained in:
		
							parent
							
								
									bdcbc09dc7
								
							
						
					
					
						commit
						a992fac902
					
				@ -12,7 +12,6 @@ logger = logging.getLogger()
 | 
				
			|||||||
class RA(object):
 | 
					class RA(object):
 | 
				
			||||||
    def __init__(self, conf = None, tpl_name = None, tpl_dir = None, *args, **kwargs):
 | 
					    def __init__(self, conf = None, tpl_name = None, tpl_dir = None, *args, **kwargs):
 | 
				
			||||||
        self.conf = RAConf(conf = conf, tpl_name = tpl_name, tpl_dir = tpl_dir, *args, **kwargs)
 | 
					        self.conf = RAConf(conf = conf, tpl_name = tpl_name, tpl_dir = tpl_dir, *args, **kwargs)
 | 
				
			||||||
        self.svc = RASvc()
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class RAConf(object):
 | 
					class RAConf(object):
 | 
				
			||||||
@ -48,7 +47,6 @@ class RAConf(object):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class RASvc(object):
 | 
					class RASvc(object):
 | 
				
			||||||
    name = None
 | 
					 | 
				
			||||||
    is_systemd = False
 | 
					    is_systemd = False
 | 
				
			||||||
    cmd_tpl = None
 | 
					    cmd_tpl = None
 | 
				
			||||||
    has_pkill = False
 | 
					    has_pkill = False
 | 
				
			||||||
@ -56,7 +54,8 @@ class RASvc(object):
 | 
				
			|||||||
    stop_cmd = None
 | 
					    stop_cmd = None
 | 
				
			||||||
    restart_cmd = None
 | 
					    restart_cmd = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __init__(self):
 | 
					    def __init__(self, name):
 | 
				
			||||||
 | 
					        self.name = name
 | 
				
			||||||
        self._get_manager()
 | 
					        self._get_manager()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _exec(self, cmd):
 | 
					    def _exec(self, cmd):
 | 
				
			||||||
@ -142,6 +141,7 @@ class RADVD(RA):
 | 
				
			|||||||
        if not tpl_name:
 | 
					        if not tpl_name:
 | 
				
			||||||
            tpl_name = self.tpl_name
 | 
					            tpl_name = self.tpl_name
 | 
				
			||||||
        super().__init__(conf = conf, tpl_name = tpl_name, tpl_dir = tpl_dir)
 | 
					        super().__init__(conf = conf, tpl_name = tpl_name, tpl_dir = tpl_dir)
 | 
				
			||||||
 | 
					        self.svc = RASvc(self.name)
 | 
				
			||||||
        self.conf.ext_init()
 | 
					        self.conf.ext_init()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -156,4 +156,5 @@ class DNSMasq(RA):
 | 
				
			|||||||
        if not tpl_name:
 | 
					        if not tpl_name:
 | 
				
			||||||
            tpl_name = self.tpl_name
 | 
					            tpl_name = self.tpl_name
 | 
				
			||||||
        super().__init__(conf = conf, tpl_name = tpl_name, tpl_dir = tpl_dir)
 | 
					        super().__init__(conf = conf, tpl_name = tpl_name, tpl_dir = tpl_dir)
 | 
				
			||||||
 | 
					        self.svc = RASvc(self.name)
 | 
				
			||||||
        self.conf.ext_init()
 | 
					        self.conf.ext_init()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user