RF: is_alive -> isAlive to stay consistent in camelCasing

pull/1346/head
Yaroslav Halchenko 2015-07-16 17:14:10 -04:00 committed by sebres
parent 59bf5013c0
commit 78eb4d95eb
5 changed files with 11 additions and 11 deletions

View File

@ -229,7 +229,7 @@ class Jail:
self.actions.join()
logSys.info("Jail '%s' stopped" % self.name)
def is_alive(self):
"""Check jail "is_alive" by checking filter and actions threads.
def isAlive(self):
"""Check jail "isAlive" by checking filter and actions threads.
"""
return self.filter.is_alive() or self.actions.is_alive()
return self.filter.isAlive() or self.actions.isAlive()

View File

@ -157,7 +157,7 @@ class Server:
def startJail(self, name):
try:
self.__lock.acquire()
if not self.__jails[name].is_alive():
if not self.__jails[name].isAlive():
self.__jails[name].start()
finally:
self.__lock.release()
@ -166,7 +166,7 @@ class Server:
logSys.debug("Stopping jail %s" % name)
try:
self.__lock.acquire()
if self.__jails[name].is_alive():
if self.__jails[name].isAlive():
self.__jails[name].stop()
self.delJail(name)
finally:
@ -323,12 +323,12 @@ class Server:
def getBanTime(self, name):
return self.__jails[name].actions.getBanTime()
def is_alive(self, jailnum=None):
def isAlive(self, jailnum=None):
if jailnum is not None and len(self.__jails) != jailnum:
return 0
for j in self.__jails:
j = self.__jails[j]
if not j.is_alive():
if not j.isAlive():
return 0
return 1

View File

@ -85,5 +85,5 @@ class DummyJail(Jail, object):
def actions(self):
return self.__actions;
def is_alive(self):
def isAlive(self):
return True;

View File

@ -594,7 +594,7 @@ def get_monitor_failures_testcase(Filter_):
# actions might be happening too fast in the tests,
# sleep a bit to guarantee reliable time stamps
if isinstance(self.filter, FilterPoll):
Utils.wait_for(lambda: self.filter.is_alive(), 4*Utils.DEFAULT_SLEEP_TIME)
Utils.wait_for(lambda: self.filter.isAlive(), 4*Utils.DEFAULT_SLEEP_TIME)
def isEmpty(self, delay=4*Utils.DEFAULT_SLEEP_TIME):
# shorter wait time for not modified status

View File

@ -236,7 +236,7 @@ class Transmitter(TransmitterBase):
time.sleep(Utils.DEFAULT_SLEEP_TIME)
# wait until not started (3 seconds as long as any RuntimeError, ex.: RuntimeError('cannot join thread before it is started',)):
self.assertTrue( Utils.wait_for(
lambda: self.server.is_alive(1) and not isinstance(self.transm.proceed(["status", self.jailName]), RuntimeError),
lambda: self.server.isAlive(1) and not isinstance(self.transm.proceed(["status", self.jailName]), RuntimeError),
3) )
self.assertEqual(
self.transm.proceed(["stop", self.jailName]), (0, None))
@ -253,7 +253,7 @@ class Transmitter(TransmitterBase):
# giving it a small delay reliably helps to proceed with tests
time.sleep(Utils.DEFAULT_SLEEP_TIME)
self.assertTrue( Utils.wait_for(
lambda: self.server.is_alive(2) and not isinstance(self.transm.proceed(["status", self.jailName]), RuntimeError),
lambda: self.server.isAlive(2) and not isinstance(self.transm.proceed(["status", self.jailName]), RuntimeError),
3) )
self.assertEqual(self.transm.proceed(["stop", "all"]), (0, None))
self.assertTrue( Utils.wait_for( lambda: not len(self.server._Server__jails), 3) )