summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-04-01 17:51:04 +0000
committerAlan Conway <aconway@apache.org>2010-04-01 17:51:04 +0000
commit66491cc2d4b35cc62b1cf038ce6cd67554f46024 (patch)
tree9fea9c862a632c483584abdb2e0826a28e63f05b /python
parent0ee2067da40e17906eb4b89a73f233d07ec5d32d (diff)
downloadqpid-python-66491cc2d4b35cc62b1cf038ce6cd67554f46024.tar.gz
Update cluster store status with a single atomic write() operation.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@930055 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
-rw-r--r--python/qpid/brokertest.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/python/qpid/brokertest.py b/python/qpid/brokertest.py
index 2f064f59b6..3608a959b1 100644
--- a/python/qpid/brokertest.py
+++ b/python/qpid/brokertest.py
@@ -373,6 +373,13 @@ class Broker(Popen):
try: self.connect().close()
except: raise RethrownException("Broker %s failed ready test"%self.name)
+ def store_state(self):
+ uuids = open(os.path.join(self.datadir, "cluster", "store.status")).readlines()
+ null_uuid="00000000-0000-0000-0000-000000000000\n"
+ if uuids[0] == null_uuid: return "empty"
+ if uuids[1] == null_uuid: return "dirty"
+ return "clean"
+
class Cluster:
"""A cluster of brokers in a test."""