-
Notifications
You must be signed in to change notification settings - Fork 101
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
Fixes #8901 - Make new apipie method optional #120
Conversation
Apipie.configuration.checksum_path += ['/discovered_hosts/'] | ||
end | ||
else | ||
if Apipie.configuration.respond_to?(:checksum_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can stay outside the version conditional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whatever, please update so I can test this and give it go. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @domcleal, good catch.
@GregSutcliffe - tested with foreman-1.7-stable. Works well. |
Ha, does not work with develop branch :-(
|
c3982d7
to
451c486
Compare
@lzap ouch, sorry. Updated to work with both 1.7 and nightly. Still ugly though :) |
@@ -107,7 +107,10 @@ class Engine < ::Rails::Engine | |||
allowed_template_helpers :rand, :facts_hash | |||
|
|||
# apipie API documentation | |||
apipie_documented_controllers ["#{ForemanDiscovery::Engine.root}/app/controllers/api/v2/*.rb"] | |||
# Only available in 1.8, otherwise it has to be in the initializer below | |||
if (SETTINGS[:version].to_s.include?('develop') or Gem::Version.new(SETTINGS[:version]) >= Gem::Version.new('1.8')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usually we use Gem::Version.new(SETTINGS[:version].chomp('-develop'))
(although ideally we never do version comparisons!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed its ugly. @lzap is it better to revert the original change to the apipie usage until after we're done with 1.7?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with this. Filed issue ticket for 2.1 to remove this workaround: http://projects.theforeman.org/issues/9017
Going to test this. Thanks.
Works both for 1.7 and develop. Merged as 451c486 thanks. |
This is pretty ugly, but it allows us to retain the previous behaviour from before f1f29ca#diff-9c896d7540d8746964738086b33782b7L112 was added (which breaks 1.7 support, and I'd like to keep 1.7 for discovery 2.0). Suggestions on cleaner handling are welcome.