summaryrefslogtreecommitdiffstats
path: root/openstack/common/rpc
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-05-13 20:44:18 +0000
committerGerrit Code Review <review@openstack.org>2013-05-13 20:44:18 +0000
commit3e336928cbd5caa689d04e40786607cbb90f3ec0 (patch)
treebc02694debf6f278930b7f0835f300d5999b0f74 /openstack/common/rpc
parent670c68f7a14fd3be918ce9dc2a663913fe27a37e (diff)
parenta51469326e84ed977ecc4e57fd3d46cdc21aa08f (diff)
downloadoslo-3e336928cbd5caa689d04e40786607cbb90f3ec0.tar.gz
oslo-3e336928cbd5caa689d04e40786607cbb90f3ec0.tar.xz
oslo-3e336928cbd5caa689d04e40786607cbb90f3ec0.zip
Merge "Removes len() on empty sequence evaluation"
Diffstat (limited to 'openstack/common/rpc')
-rw-r--r--openstack/common/rpc/impl_zmq.py4
-rw-r--r--openstack/common/rpc/matchmaker.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/openstack/common/rpc/impl_zmq.py b/openstack/common/rpc/impl_zmq.py
index 7a5d814..fec299c 100644
--- a/openstack/common/rpc/impl_zmq.py
+++ b/openstack/common/rpc/impl_zmq.py
@@ -180,7 +180,7 @@ class ZmqSocket(object):
return
# We must unsubscribe, or we'll leak descriptors.
- if len(self.subscriptions) > 0:
+ if self.subscriptions:
for f in self.subscriptions:
try:
self.sock.setsockopt(zmq.UNSUBSCRIBE, f)
@@ -763,7 +763,7 @@ def _multi_send(method, context, topic, msg, timeout=None,
LOG.debug(_("Sending message(s) to: %s"), queues)
# Don't stack if we have no matchmaker results
- if len(queues) == 0:
+ if not queues:
LOG.warn(_("No matchmaker results. Not casting."))
# While not strictly a timeout, callers know how to handle
# this exception and a timeout isn't too big a lie.
diff --git a/openstack/common/rpc/matchmaker.py b/openstack/common/rpc/matchmaker.py
index 7366246..3d72ae7 100644
--- a/openstack/common/rpc/matchmaker.py
+++ b/openstack/common/rpc/matchmaker.py
@@ -245,7 +245,7 @@ class HeartbeatMatchMakerBase(MatchMakerBase):
yielding for CONF.matchmaker_heartbeat_freq seconds
between iterations.
"""
- if len(self.hosts) == 0:
+ if not self.hosts:
raise MatchMakerException(
_("Register before starting heartbeat."))