Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bug: Alerts V2 throws unexpected KeyError #176

Copy link
Copy link
@harsh-leen

Description

@harsh-leen
Issue body actions

Describe the bug
When lacework environment contains zero alerts, python-sdk is not able to handle the json response correctly and throws unexpected KeyError.

Sample trace:

Traceback (most recent call last):
    ...
    alerts = self.lacework_client.alerts.get(
  File ".../lib/python3.10/site-packages/laceworksdk/api/v2/alerts.py", line 50, in get
    return_data["paging"] = response_json["paging"]
KeyError: 'paging'

To Reproduce
Steps to reproduce the behavior:

  1. Use lacework env with 0 alerts
  2. Initialize the client and fetch alerts in following manner:
alerts = lacework_client.alerts.get(
    start_time=start_time_str, end_time=end_time_str
)

Please complete the following information:

  • OS: macOS Sonoma 14.5 on ARM
  • Library Version: Current latest eg. 4.1.0
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.