Repository navigation
fix: gtm topology region to allow spaced names - #2534
Merged
Merged
Conversation
Ref:AUTOTOOL-5338
crosbygw
approved these changes
Sep 16, 2026
crosbygw
left a comment
Collaborator
There was a problem hiding this comment.
I reviewed the diff against devel for bigip_gtm_topology_region.py. This change extends an existing fix (spaces-in-values escaping for region members) to also cover spaces in the region name itself.
Result: No bugs found. Key points verified:
- ModuleParameters.name correctly strips surrounding quotes and is only read from want (never diffed against have), so no spurious "changed" state.
- escape_spaces's new not -prefix handling correctly isolates the prefix before matching against keys_with_potential_spaces; no ambiguity since none of those keys are substrings of each other.
- tmsh_name output format is consistent with existing escaping conventions elsewhere in the codebase (e.g. bigip_gtm_monitor_external.py).
- The resulting tmsh command payload is well-formed.
Minor (non-blocking) notes:
- Changelog fragment wording now aligns better with the module-prefixed naming convention used in other fragments — a slight improvement.
- New unit tests directly exercise the new behavior rather than just re-asserting old coverage.
One caveat: the pre-existing test suite has an unrelated failure (test_create_topology_region) tied to an Ansible version/environment issue — this fails identically on devel, so it's not caused by this change.
Overall: clean, well-tested follow-up applying the same escaping pattern to region names. No required changes.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Supports spaces in GTM topology region names and member values within the
bigip_gtm_topology_regionmodule. Region names containing spaces are now properly escape-quoted for tmsh execution via the bash endpoint, preventing bash from splitting names into separate arguments.Changes
Module
ansible_collections/f5networks/f5_modules/plugins/modules/bigip_gtm_topology_region.py:tmsh_nameproperty toModuleManagerto ensure fully-qualified region names containing spaces are escape-quoted (\"/Common/Test Space\") when formatted into tmsh bash payloads.create_on_device()andupdate_on_device()to useself.tmsh_name.nameproperty toModuleParametersto strip redundant surrounding quotes from user input, ensuring consistent resource resolution across tmsh and REST endpoints.UsableChanges.escape_spaces()to handle negated member entries with spaces (not state ...,not datacenter ...).Tests
ansible_collections/f5networks/f5_modules/tests/unit/modules/network/f5/test_bigip_gtm_topology_region.py:test_tmsh_name_with_spacesto verify region names with spaces are properly escape-quoted.test_tmsh_name_without_spacesto verify region names without spaces remain unquoted.test_tmsh_name_with_custom_partition_and_spacesto verify partition preservation with spaces.test_module_parameters_strips_external_quotes_from_nameandtest_module_parameters_name_none.test_escape_spaces_negate_state_with_spacesandtest_escape_spaces_negate_datacenter_with_spaces.test_create_on_device_with_spaces_in_nameandtest_update_on_device_with_spaces_in_nameto validate the generated bash API payload.Changelog
ansible_collections/f5networks/f5_modules/changelogs/fragments/fix-gtm-spaces-in-names.yaml:Testing
pytestagainsttest_bigip_gtm_topology_region.py(24 passed).ansible-test sanityacross modified modules, tests, and fragments (25 sanity checks passed).ansible-lint(0 failures, 0 warnings).Checklist
Ref:AUTOTOOL-5338