simplify init code

This commit is contained in:
Honza Král
2016-06-28 00:40:06 +02:00
parent 9f2608c469
commit f28b634e17
+8 -7
View File
@@ -173,13 +173,14 @@ class Elasticsearch(object):
# namespaced clients for compatibility with API names
# use weakref to make GC's work a little easier
self.indices = IndicesClient(weakref.proxy(self))
self.ingest = IngestClient(weakref.proxy(self))
self.cluster = ClusterClient(weakref.proxy(self))
self.cat = CatClient(weakref.proxy(self))
self.nodes = NodesClient(weakref.proxy(self))
self.snapshot = SnapshotClient(weakref.proxy(self))
self.tasks = TasksClient(weakref.proxy(self))
client = weakref.proxy(self)
self.indices = IndicesClient(client)
self.ingest = IngestClient(client)
self.cluster = ClusterClient(client)
self.cat = CatClient(client)
self.nodes = NodesClient(client)
self.snapshot = SnapshotClient(client)
self.tasks = TasksClient(client)
def __repr__(self):
try: