[pull] master from kevoreilly:master#385
Merged
pull[bot] merged 3 commits intothreatcode:masterfrom Jan 22, 2026
Merged
Conversation
Updated label text and enhanced options help section with detailed descriptions of available options.
* Improve Azure VMSS error handling and logging
Adds handling for ResourceNotFoundError when listing VMSS VMs and NICs, preventing exceptions when VMSS capacity is zero. Improves logging for VMSS deletion conditions and corrects log formatting in reimage and delete threads. Also wraps VMSS creation logic in a broader exception handler for robustness.
✦ Here is the summary of changes specifically for the Azure machinery module (`modules/machinery/az.py`):
Azure Machinery (`az.py`) Enhancements
* Zero-Scale Compatibility:
* Added handling for ResourceNotFoundError in _add_machines_to_db and _delete_machines_from_db_if_missing. This prevents the module from crashing when a Virtual Machine Scale Set (VMSS) has a capacity of 0,
enabling the "scale from zero" cost-saving feature.
* External Management Support:
* Updated _process_pre_existing_vmsss to honor the just_start parameter. This prevents CAPE from automatically deleting VMSSs that don't match its internal tags/names if they are managed by external tools
like Terraform or Ansible.
* Robust Connection Logic:
* Refactored _thr_wait_for_ready_machine to use an explicit socket creation and getaddrinfo iteration loop. This fixes potential thread hangs, improves reliability on busy systems, and adds full support for
DNS hostnames and IPv6 addresses.
* Thread Stability & Error Handling:
* Wrapped the _thr_create_vmss background thread in a top-level exception handler to ensure that failures during VMSS creation (e.g., subnet issues or API errors) are logged instead of failing silently.
* Bug Fixes & Logging:
* Fixed malformed logging strings in the batch reimage and delete list readers (previously using incorrect set literal syntax and missing format arguments).
* Added detailed debug logging for VMSS deletion and zero-capacity scenarios to improve troubleshooting.
* Ensured proper import of ResourceNotFoundError from azure.core.exceptions.
* Update modules/machinery/az.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* Update modules/machinery/az.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )