|
6 | 6 |
|
7 | 7 | from cbapi.errors import TimeoutError
|
8 | 8 | from cbapi.live_response_api import CbLRManagerBase, CbLRSessionBase, poll_status
|
9 |
| -from cbapi.psc.models import Device |
10 | 9 |
|
11 | 10 |
|
12 | 11 | OS_LIVE_RESPONSE_ENUM = {
|
|
21 | 20 | class LiveResponseSession(CbLRSessionBase):
|
22 | 21 | def __init__(self, cblr_manager, session_id, sensor_id, session_data=None):
|
23 | 22 | super(LiveResponseSession, self).__init__(cblr_manager, session_id, sensor_id, session_data=session_data)
|
| 23 | + from cbapi.psc.defense.models import Device |
24 | 24 | device_info = self._cb.select(Device, self.sensor_id)
|
25 | 25 | self.os_type = OS_LIVE_RESPONSE_ENUM.get(device_info.deviceType, None)
|
26 | 26 |
|
27 | 27 |
|
28 | 28 | class WorkItem(object):
|
29 | 29 | def __init__(self, fn, sensor_id):
|
| 30 | + from cbapi.psc.defense.models import Device |
30 | 31 | self.fn = fn
|
31 | 32 | if isinstance(sensor_id, Device):
|
32 | 33 | self.sensor_id = sensor_id.deviceId
|
@@ -228,6 +229,7 @@ def submit_job(self, work_item):
|
228 | 229 | self.schedule_queue.put(work_item)
|
229 | 230 |
|
230 | 231 | def _spawn_new_workers(self):
|
| 232 | + from cbapi.psc.defense.models import Device |
231 | 233 | if len(self._job_workers) >= self._max_workers:
|
232 | 234 | return
|
233 | 235 |
|
|
0 commit comments