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

Make named url work with optional url prefix #15114

Merged

Conversation

chrismeyersfsu
Copy link
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
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 merged commit 08e1454 into ansible:devel May 29, 2024
21 checks passed
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