Project

General

Profile

Bug #4728

apipie dynamic bindings prevent foretello hammer from working

Added by Thomas McKay over 6 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Urgent
Assignee:
Category:
-
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Pull request:
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

History

#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

#2 Updated by Adam Price over 6 years ago

  • Assignee set to Adam Price

#3 Updated by Adam Price over 6 years ago

  • Project changed from Hammer CLI to Katello
  • Category changed from Hammer core to 106

#4 Updated by Adam Price over 6 years ago

  • Assignee changed from Adam Price to Ivan Necas

#5 Updated by Ivan Necas over 6 years ago

Proper apipie fix proposal is here:

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

#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.

#7 Updated by Ivan Necas over 6 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).

#8 Updated by Ivan Necas over 6 years ago

  • Status changed from Ready For Testing to Resolved

#9 Updated by Eric Helms over 6 years ago

  • Triaged set to Yes

#10 Updated by Eric Helms about 6 years ago

  • Legacy Backlogs Release (now unused) set to 13

Also available in: Atom PDF