Skip to content

Make named url work with optional url prefix#15114

Merged
chrismeyersfsu merged 1 commit into
ansible:develfrom
chrismeyersfsu:AAP-22853-fix-named-url
May 29, 2024
Merged

Make named url work with optional url prefix#15114
chrismeyersfsu merged 1 commit into
ansible:develfrom
chrismeyersfsu:AAP-22853-fix-named-url

Conversation

@chrismeyersfsu
Copy link
Copy Markdown
Member

SUMMARY
  • Make named url work with optional url prefix
ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • API
AWX VERSION
devel
ADDITIONAL INFORMATION

@AlanCoding
Copy link
Copy Markdown
Member

This is really hard to parse. My reading is that the job of this method is to extract the named component of the URL, and then call the method that gets the pk from that, and glue it back together and return that. I would like the high-level conditional to be more clear. Like, after stripping the leading/trailing slashes, .startswith("api/v2") seems like it would be a really durable and understandable heuristic. The stuff with counting the number of slashes starts looking like insanity.

@chrismeyersfsu chrismeyersfsu force-pushed the AAP-22853-fix-named-url branch 3 times, most recently from ed68eac to aa91009 Compare May 9, 2024 19:11
@PabloHiro PabloHiro self-requested a review May 13, 2024 15:12
* Handle named url sub-resources
* i.e. /api/v2/inventories/my_inventory++Default/hosts/
@chrismeyersfsu chrismeyersfsu force-pushed the AAP-22853-fix-named-url branch from aa91009 to 3464417 Compare May 13, 2024 15:17
@chrismeyersfsu chrismeyersfsu enabled auto-merge (rebase) May 21, 2024 00:36
@chrismeyersfsu chrismeyersfsu merged commit 08e1454 into ansible:devel May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants