Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] python 3.6 doesnt like import Queue in event.py #288

Open
chrisnewmanuk opened this issue Feb 10, 2021 · 0 comments
Open

[BUG] python 3.6 doesnt like import Queue in event.py #288

chrisnewmanuk opened this issue Feb 10, 2021 · 0 comments
Assignees
Labels

Comments

@chrisnewmanuk
Copy link

chrisnewmanuk commented Feb 10, 2021

** Prep **
pip3 install cbapi

Describe the bug
As per screenshot.

Steps to Reproduce
(cribbed from https://github.com/carbonblack/cbapi-python/blob/master/examples/response/event/get_reg_autoruns.py)

from cbapi.event import on_event, registry
from cbapi.example_helpers import get_cb_response_object, build_cli_parser
import re
from cbapi.response import sensor_events, event
import sys
import time

class DirectoryList(object):
def init(self, directory):
self.directory = directory

def run(self, session):
    result = None
    try:
        result = session.list_directory(self.directory)
    except:
        result = "could not get dir list"
    return result

def main():

parser.add_argument("-H", "--hostname", help="Hostname to download from", required=True)
args = parser.parse_args()
cb = get_cb_response_object(args)
sensors = cb.select(Sensor).where("hostname:{0}".format(args.hostname))
for sensor in sensors:
    job = DirectoryList("c:\\")
    x = cb.live_response.submit_job(job.run, sensor.sensor_id)

Expected behavior
Events can be queued via submit_job() without errors

Screenshots
image

Additional context
Tried to fix Queue to queue trick but that didnt work and resulted in:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants