镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Description

@chrisnewmanuk

** 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

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions