summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/prserv
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-31 17:21:23 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-31 23:30:03 +0100
commit6e1ab28e94bf71ffd6a7fe5ba9346c22716dbfa9 (patch)
tree7272730617a78a9d7a260dc28b127991aa032144 /bitbake/lib/prserv
parent93a54f3432752646d53439210de6769368fb466e (diff)
downloadpoky-6e1ab28e94bf71ffd6a7fe5ba9346c22716dbfa9.tar.gz
bitbake: prserv/serv: Rename self.quit -> self.quitflag
self has a quit function and a variable. Separate this to two different things as the current setup is prone to breakage. (Bitbake rev: ba7e3c73d8f4d2bd1d7434b97c326e7ab935231a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/prserv')
-rw-r--r--bitbake/lib/prserv/serv.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/bitbake/lib/prserv/serv.py b/bitbake/lib/prserv/serv.py
index 6be78c82fb..dfcbd2058f 100644
--- a/bitbake/lib/prserv/serv.py
+++ b/bitbake/lib/prserv/serv.py
@@ -78,7 +78,7 @@ class PRServer(SimpleXMLRPCServer):
78 78
79 bb.utils.set_process_name("PRServ Handler") 79 bb.utils.set_process_name("PRServ Handler")
80 80
81 while not self.quit: 81 while not self.quitflag:
82 try: 82 try:
83 (request, client_address) = self.requestqueue.get(True, 30) 83 (request, client_address) = self.requestqueue.get(True, 30)
84 except queue.Empty: 84 except queue.Empty:
@@ -142,7 +142,7 @@ class PRServer(SimpleXMLRPCServer):
142 return self.table.importone(version, pkgarch, checksum, value) 142 return self.table.importone(version, pkgarch, checksum, value)
143 143
144 def ping(self): 144 def ping(self):
145 return not self.quit 145 return not self.quitflag
146 146
147 def getinfo(self): 147 def getinfo(self):
148 return (self.host, self.port) 148 return (self.host, self.port)
@@ -158,13 +158,13 @@ class PRServer(SimpleXMLRPCServer):
158 return None 158 return None
159 159
160 def quit(self): 160 def quit(self):
161 self.quit=True 161 self.quitflag=True
162 os.write(self.quitpipeout, b"q") 162 os.write(self.quitpipeout, b"q")
163 os.close(self.quitpipeout) 163 os.close(self.quitpipeout)
164 return 164 return
165 165
166 def work_forever(self,): 166 def work_forever(self,):
167 self.quit = False 167 self.quitflag = False
168 # This timeout applies to the poll in TCPServer, we need the select 168 # This timeout applies to the poll in TCPServer, we need the select
169 # below to wake on our quit pipe closing. We only ever call into handle_request 169 # below to wake on our quit pipe closing. We only ever call into handle_request
170 # if there is data there. 170 # if there is data there.
@@ -180,9 +180,9 @@ class PRServer(SimpleXMLRPCServer):
180 (self.dbfile, self.host, self.port, str(os.getpid()))) 180 (self.dbfile, self.host, self.port, str(os.getpid())))
181 181
182 self.handlerthread.start() 182 self.handlerthread.start()
183 while not self.quit: 183 while not self.quitflag:
184 ready = select.select([self.fileno(), self.quitpipein], [], [], 30) 184 ready = select.select([self.fileno(), self.quitpipein], [], [], 30)
185 if self.quit: 185 if self.quitflag:
186 break 186 break
187 if self.fileno() in ready[0]: 187 if self.fileno() in ready[0]:
188 self.handle_request() 188 self.handle_request()