Update app_svc.py#3198
Conversation
Skip swap files created by nano while developing rules
|
Thoughts on swapping this out for only accepting .yml/.yaml files and nothing else? This would be more effective than playing whack-a-mole with other file extensions that may pop up due to other text editors |
|
@uruwhy , that's a great idea honestly.. this was just a quick fix while I was in the middle of another project.. The swp files here are binary and were capable of crashing the caldera instance. |
Update logic to exclude all non yml files
There was a problem hiding this comment.
Pull Request Overview
This PR adds a file filter to prevent the application from processing non-YAML files when watching for ability file changes, specifically addressing errors caused by nano editor swap files during development.
- Adds a check to skip files that don't end with '.yml' extension
- Includes debug logging for skipped files
- Prevents UnicodeDecodeError exceptions from binary swap files
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|



Skip swap files created by nano while developing rules.
Description
Small fix for app_svc to avoid errors from swp files while locally editing with nano while caldera is running.
Type of change
How Has This Been Tested?
Tested locally, after making the change nano editing no longer throws errors (like the following)
Checklist:
(none needed)