Parcourir la source

[213] Pass as parameter, not modify afterwards

It is cleaner to pass the parameter to parent class constructor than
overwrite the protected member afterwards.
Michal 'vorner' Vaner il y a 13 ans
Parent
commit
65b9917a96
1 fichiers modifiés avec 4 ajouts et 8 suppressions
  1. 4 8
      src/lib/python/isc/bind10/special_component.py

+ 4 - 8
src/lib/python/isc/bind10/special_component.py

@@ -58,27 +58,23 @@ class Msgq(Component):
 
 class CfgMgr(Component):
     def __init__(self, process, boss, kind, address=None, params=None):
-        Component.__init__(self, process, boss, kind)
+        Component.__init__(self, process, boss, kind, 'ConfigManager')
         self._start_func = boss.start_cfgmgr
-        self._address = 'ConfigManager'
 
 class Auth(Component):
     def __init__(self, process, boss, kind, address=None, params=None):
-        Component.__init__(self, process, boss, kind)
+        Component.__init__(self, process, boss, kind, 'Auth')
         self._start_func = boss.start_auth
-        self._address = 'Auth'
 
 class Resolver(Component):
     def __init__(self, process, boss, kind, address=None, params=None):
-        Component.__init__(self, process, boss, kind)
+        Component.__init__(self, process, boss, kind, 'Resolver')
         self._start_func = boss.start_resolver
-        self._address = 'Resolver'
 
 class CmdCtl(Component):
     def __init__(self, process, boss, kind, address=None, params=None):
-        Component.__init__(self, process, boss, kind)
+        Component.__init__(self, process, boss, kind, 'Cmdctl')
         self._start_func = boss.start_cmdctl
-        self._address = 'Cmdctl'
 
 def get_specials():
     """