apipie dynamic bindings prevent foretello hammer from working
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.
% hammer system list --organization-id ACME_Corporation
#1 Updated by Ivan Necas over 6 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
#6 Updated by Ivan Necas over 6 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.