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

Discuss ADR: Safe File and Plist Handling Functions #892

Open
JamesHabben opened this issue Oct 21, 2024 · 1 comment
Open

Discuss ADR: Safe File and Plist Handling Functions #892

JamesHabben opened this issue Oct 21, 2024 · 1 comment
Assignees

Comments

@JamesHabben
Copy link
Collaborator

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

@JamesHabben JamesHabben changed the title ADR Discussion: Safe File and Plist Handling Functions Discuss ADR: Safe File and Plist Handling Functions Oct 21, 2024
@JamesHabben
Copy link
Collaborator Author

after chat discussion, sounds like we want to include a safe open function to open ccl data

@Johann-PLW Johann-PLW self-assigned this Nov 18, 2024
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

No branches or pull requests

2 participants