Commit 40fc5505 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Replace 'while 1' statements with 'while True'.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1495 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 82f27499
......@@ -91,10 +91,10 @@ class Application(object):
# Connect to a primary master node, verify data, and
# start the operation. This cycle will be executed permentnly,
# until the user explicitly requests a shutdown.
while 1:
while True:
self.connectToPrimary()
try:
while 1:
while True:
self.em.poll(1)
except PrimaryFailure:
logging.error('primary master is down')
......
......@@ -297,7 +297,7 @@ class Application(object):
def _waitMessage(self, target_conn = None, msg_id = None, handler=None):
"""Wait for a message returned by the dispatcher in queues."""
local_queue = self.local_var.queue
while 1:
while True:
if msg_id is None:
try:
conn, packet = local_queue.get_nowait()
......
......@@ -235,7 +235,7 @@ class Connection(BaseConnection):
def analyse(self):
"""Analyse received data."""
while 1:
while True:
packet = None
try:
packet = Packets.parse(self.read_buf)
......
......@@ -80,7 +80,7 @@ class Epoll(object):
else:
timeout *= 1000
timeout = int(timeout)
while 1:
while True:
n = epoll_wait(self.efd, byref(self.events), self.maxevents,
timeout)
if n == -1:
......
......@@ -109,7 +109,7 @@ class Application(object):
self.electPrimary()
# Start a normal operation.
while 1:
while True:
try:
if self.primary:
self.playPrimaryRole()
......@@ -466,7 +466,7 @@ class Application(object):
if len(self.asking_uuid_dict) == 0:
raise VerificationFailure
while 1:
while True:
em.poll(1)
if not self.pt.operational():
raise VerificationFailure
......@@ -494,7 +494,7 @@ class Application(object):
self.asking_uuid_dict[uuid] = False
conn.ask(Packets.AskObjectPresent(oid, tid))
while 1:
while True:
em.poll(1)
if not self.pt.operational():
raise VerificationFailure
......@@ -531,7 +531,7 @@ class Application(object):
self.asking_uuid_dict[uuid] = False
conn.ask(Packets.AskUnfinishedTransactions())
while 1:
while True:
em.poll(1)
if not self.pt.operational():
raise VerificationFailure
......@@ -633,7 +633,7 @@ class Application(object):
# recover the cluster status at startup
self.recoverStatus()
while 1:
while True:
try:
self.verifyData()
except VerificationFailure:
......@@ -657,7 +657,7 @@ class Application(object):
handler = identification.IdentificationHandler(self)
self.listening_conn.setHandler(handler)
while 1:
while True:
self.em.poll(1)
def changeClusterState(self, state):
......@@ -740,7 +740,7 @@ class Application(object):
c.setHandler(handler)
# wait for all transaction to be finished
while 1:
while True:
self.em.poll(1)
if not self.tm.hasPending():
if self.cluster_state == ClusterStates.RUNNING:
......
......@@ -140,12 +140,12 @@ class Application(object):
# Connect to a primary master node, verify data, and
# start the operation. This cycle will be executed permentnly,
# until the user explicitly requests a shutdown.
while 1:
while True:
# look for the primary master
self.connectToPrimary()
self.operational = False
try:
while 1:
while True:
try:
# check my state
node = self.nm.getByUUID(self.uuid)
......@@ -262,7 +262,7 @@ class Application(object):
# The replicator.
self.replicator = Replicator(self)
while 1:
while True:
em.poll(1)
if self.replicator.pending():
self.replicator.act()
......@@ -275,7 +275,7 @@ class Application(object):
conn.setHandler(handler)
node = self.nm.getByUUID(self.uuid)
while 1:
while True:
self.em.poll(1)
if not node.isHidden():
break
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment