Project

General

Profile

Actions

Bug #4728

closed

apipie dynamic bindings prevent foretello hammer from working

Added by Thomas McKay about 10 years ago. Updated almost 6 years ago.

Status:
Resolved
Priority:
Urgent
Assignee:
Category:
-
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Prior to dynamic bindings, whenever the generate katello_api script was run against a foretello server, it would need to be restarted. This is due to the Organization model not getting the katello extensions, causing errors later when a katello field was being accessed (error message is: undefined method `without_deleting'). The server would need to be restarted after the generate script.

With the introduction of dynamic bindings, this happens every time a hammer command is run and the cache needs to be refreshed (which is every server restart). I am unaware of any work arounds.

To reproduce:
% hammer system list --organization-id ACME_Corporation

Actions #1

Updated by Ivan Necas about 10 years ago

the workaround for development should be setting `use_cache = true` in https://github.com/theforeman/foreman/blob/develop/config/initializers/apipie.rb#L10 (maybe also reload_controllers = false) and generating the the cache with `rake apipie:cache`. This way, the api is loaded from cache in development as well, so this issues should not appear: to refresh the cache, one should need just run the rake task again

Actions #2

Updated by Adam Price about 10 years ago

  • Assignee set to Adam Price
Actions #3

Updated by Adam Price about 10 years ago

  • Project changed from Hammer CLI to Katello
  • Category changed from Hammer core to 106
Actions #4

Updated by Adam Price about 10 years ago

  • Assignee changed from Adam Price to Ivan Necas
Actions #5

Updated by Ivan Necas about 10 years ago

Proper apipie fix proposal is here:

https://github.com/Apipie/apipie-rails/pull/228

Actions #6

Updated by Ivan Necas about 10 years ago

  • Status changed from New to Assigned

Workaround tested as well: all you need is setting `use_cache = true` in https://github.com/theforeman/foreman/blob/develop/config/initializers/apipie.rb#L10 and run `bundle exec rake apipie:cache`.

Martin should also work on a PR to foreman to use the cache even in devel when it's generated.

Actions #7

Updated by Ivan Necas about 10 years ago

  • Status changed from Assigned to Ready For Testing

apipie-rails-0.1.2 released with the fix, rpms build as well (although the production mode was not affected).

Actions #8

Updated by Ivan Necas about 10 years ago

  • Status changed from Ready For Testing to Resolved
Actions #9

Updated by Eric Helms almost 10 years ago

  • Triaged set to Yes
Actions #10

Updated by Eric Helms over 9 years ago

  • translation missing: en.field_release set to 13
Actions

Also available in: Atom PDF