Skip to content

Discuss ADR: Safe File and Plist Handling Functions #892

Open
@JamesHabben

Description

Implement Safe File and Plist Handling Functions

Context

Currently, artifact modules handle file opening and plist parsing directly, without consistent error handling. This can lead to module failures that stop the execution of the entire artifact when encountering issues.

Proposal

Implement two new utility functions in ilapfuncs.py:

  1. get_file_content(file_path, binary_mode=False, encoding=None)
  2. get_plist_content(file_path)

These functions will encapsulate file opening and plist parsing operations with proper error handling.

Benefits

  • Improved error handling and logging across all artifact modules
  • Simplified code in individual artifact modules
  • Consistent behavior when encountering file access or parsing issues
  • Easier maintenance and updates to error handling logic

Implementation Details

See attached ADR for full implementation details of both functions.

Discussion Points

  • Are there any other parameters needed for these functions?
  • Should we consider any additional error cases?
  • How should we approach updating existing modules to use these new functions?

Please review and provide feedback on this proposal.

https://github.com/abrignoni/iLEAPP/blob/lava-output/admin/docs/features/file_content_access_architecture.md

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions