Skip to content

Handle None values in added and removed #2

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ddl-wasanthag
Copy link

Tested the script in 6.0.2 and ran in to the following errors.

Obtaining new batch of events (Offset: 0 | Limit 1000) {'entityType': 'project', 'name': 'app-sec', 'fieldName': 'downloadedFiles', 'fieldType': 'sequence', 'before': None, 'after': None, 'unit': None, 'added': 'auditevents_20250312_170711.csv', 'removed': ''} {'entityType': 'project', 'name': 'app-sec'} {'entityType': 'run', 'name': 'LauncherRunCommand'} {'entityType': 'run', 'name': 'LauncherRunCommand'} Traceback (most recent call last): File "/mnt/export_audit_trail.py", line 313, in <module> main() File "/mnt/export_audit_trail.py", line 119, in main export_audit_trail(args.hostname, request_headers, request_params) File "/mnt/export_audit_trail.py", line 172, in export_audit_trail parsed_events = parse_events(raw_events) File "/mnt/export_audit_trail.py", line 207, in parse_events parsed_events.append(parse_event(raw_event)) File "/mnt/export_audit_trail.py", line 244, in parse_event target_data = flatten_target(targets_raw[0]) File "/mnt/export_audit_trail.py", line 300, in flatten_target target_data["added"] = ','.join([obj.get("name") for obj in target.get("added", [])]) TypeError: sequence item 0: expected str instance, NoneType found

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

Successfully merging this pull request may close these issues.

2 participants