Skip to content

Conversation

@ofedoren
Copy link
Member

Overview of Changes

  • Somewhat reverts and updates 73bb74a.

Implementation Considerations

  • Without this change GET /api/v2/hosts/<fqdn_or_id>/power is not recognized in API calls, even though it's listed internally (e.g. rails routes command) on Rails 7.0.

Testing Steps

  • I've tried to write a test, but locally it didn't discover this issue (test passed), I've tested it by running the app with/out this patch checked on hosts index page the power state icons (they should not be grey for real machines) or just check in the logs for failed requests.

Checklists

  • I am familiar with the contributing guidelines.
  • [?] I have added relevant tests for my changes.
  • [?] I have updated the documentation accordingly.

Additional Notes

@ofedoren ofedoren force-pushed the ref-38031-use-foreman-constr branch from 498649e to b05fa02 Compare November 21, 2024 16:12
:defaults => { apiv: 'v2' },
:apiv => /v2/,
:constraints => ApiConstraints.new(version: 2, default: true) do
constraints(:id => %r{[^\/]+}) do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine merging this because it exactly matches what's in Foreman, but I wonder if %r{[^/]+} would also work?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should, since it's still accurate than the previous one, but I'd rather sync between core and plugins.

@nofaralfasi nofaralfasi merged commit 6238ea6 into theforeman:master Nov 27, 2024
26 checks passed
@nofaralfasi
Copy link
Contributor

Thanks @ofedoren!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants