[TRAIN-Only] Remove __init__ from base strategy
There is a loading issues when running under py2 that causes errors because of the way the base strategy is loaded. This change moves the variable initialization out of the base and puts it in the strategies themselves instead. It's a tiny bit of duplication but prevents loading issues when running under py2. Change-Id: I668590662dfed029a258bb21cb9c1100cee76652 Closes-Bug: #1904770
This commit is contained in:
parent
5325afc3f2
commit
4db3e083ed
|
@ -36,22 +36,6 @@ display = Display()
|
|||
|
||||
class TripleoBase(StrategyBase):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(TripleoBase, self).__init__(*args, **kwargs)
|
||||
self._any_errors_fatal = False
|
||||
self._callback_sent = False
|
||||
self._has_work = False
|
||||
self._host_pinned = False
|
||||
self._hosts_left = []
|
||||
self._iterator = None
|
||||
self._play_context = None
|
||||
self._strat_results = []
|
||||
self.noop_task = None
|
||||
self._fail_cache = {}
|
||||
# these were defined in 2.9
|
||||
self._has_hosts_cache = False
|
||||
self._has_hosts_cache_all = False
|
||||
|
||||
def _print(self, msg, host=None, level=1):
|
||||
display.verbose(msg, host=host, caplevel=level)
|
||||
|
||||
|
|
|
@ -80,6 +80,20 @@ class StrategyModule(BASE.TripleoBase):
|
|||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(StrategyModule, self).__init__(*args, **kwargs)
|
||||
self._any_errors_fatal = False
|
||||
self._callback_sent = False
|
||||
self._has_work = False
|
||||
self._host_pinned = False
|
||||
self._hosts_left = []
|
||||
self._iterator = None
|
||||
self._play_context = None
|
||||
self._strat_results = []
|
||||
self.noop_task = None
|
||||
self._fail_cache = {}
|
||||
# these were defined in 2.9
|
||||
self._has_hosts_cache = False
|
||||
self._has_hosts_cache_all = False
|
||||
# free specific vars
|
||||
self._last_host = 0
|
||||
self._workers_free = 0
|
||||
self._run_once_tasks = set()
|
||||
|
|
|
@ -75,6 +75,19 @@ class StrategyModule(BASE.TripleoBase):
|
|||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(StrategyModule, self).__init__(*args, **kwargs)
|
||||
self._any_errors_fatal = False
|
||||
self._callback_sent = False
|
||||
self._has_work = False
|
||||
self._host_pinned = False
|
||||
self._hosts_left = []
|
||||
self._iterator = None
|
||||
self._play_context = None
|
||||
self._strat_results = []
|
||||
self.noop_task = None
|
||||
self._fail_cache = {}
|
||||
# these were defined in 2.9
|
||||
self._has_hosts_cache = False
|
||||
self._has_hosts_cache_all = False
|
||||
|
||||
def _create_noop_task(self):
|
||||
"""Create noop task"""
|
||||
|
|
Loading…
Reference in New Issue