summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/hashserv/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/hashserv/client.py')
-rw-r--r--bitbake/lib/hashserv/client.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/bitbake/lib/hashserv/client.py b/bitbake/lib/hashserv/client.py
index ae5875d1b3..7bbf0865d5 100644
--- a/bitbake/lib/hashserv/client.py
+++ b/bitbake/lib/hashserv/client.py
@@ -40,7 +40,7 @@ class AsyncClient(object):
40 40
41 self._connect_sock = connect_sock 41 self._connect_sock = connect_sock
42 42
43 async def _connect(self): 43 async def connect(self):
44 if self.reader is None or self.writer is None: 44 if self.reader is None or self.writer is None:
45 (self.reader, self.writer) = await self._connect_sock() 45 (self.reader, self.writer) = await self._connect_sock()
46 46
@@ -62,7 +62,7 @@ class AsyncClient(object):
62 count = 0 62 count = 0
63 while True: 63 while True:
64 try: 64 try:
65 await self._connect() 65 await self.connect()
66 return await proc() 66 return await proc()
67 except ( 67 except (
68 OSError, 68 OSError,
@@ -190,7 +190,6 @@ class Client(object):
190 190
191 for call in ( 191 for call in (
192 "connect_tcp", 192 "connect_tcp",
193 "connect_unix",
194 "close", 193 "close",
195 "get_unihash", 194 "get_unihash",
196 "report_unihash", 195 "report_unihash",
@@ -209,6 +208,16 @@ class Client(object):
209 208
210 return wrapper 209 return wrapper
211 210
211 def connect_unix(self, path):
212 # AF_UNIX has path length issues so chdir here to workaround
213 cwd = os.getcwd()
214 try:
215 os.chdir(os.path.dirname(path))
216 self.loop.run_until_complete(self.client.connect_unix(path))
217 self.loop.run_until_complete(self.client.connect())
218 finally:
219 os.chdir(cwd)
220
212 @property 221 @property
213 def max_chunk(self): 222 def max_chunk(self):
214 return self.client.max_chunk 223 return self.client.max_chunk