Project

General

Profile

Bug #23303

hammer -r gives syntax error in katello api

Added by Rahul Bajaj about 2 years ago. Updated almost 2 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

note: Ruby version - 2.5.1
Rails version - 5.2.1

When we do `FOREMAN_APIPIE_LANGS=en rake apipie:cache:index` it gives an error like:

rake aborted!
SyntaxError: /home/vagrant/katello/app/controllers/katello/api/v2/repositories_controller.rb:19: syntax error, unexpected '{', expecting keyword_end
...n :only => [:create, :update] { find_content_credential CONT...
... ^
/home/vagrant/katello/app/controllers/katello/api/v2/repositories_controller.rb:20: syntax error, unexpected '{', expecting keyword_end
...n :only => [:create, :update] { find_content_credential CONT...
... ^
/home/vagrant/katello/app/controllers/katello/api/v2/repositories_controller.rb:21: syntax error, unexpected '{', expecting keyword_end
...n :only => [:create, :update] { find_content_credential CONT...
... ^
/home/vagrant/katello/app/controllers/katello/api/v2/repositories_controller.rb:22: syntax error, unexpected '{', expecting keyword_end
...n :only => [:create, :update] { find_content_credential CONT...
... ^
/home/vagrant/.rvm/gems/ruby-2.5.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:476:in `load'
/home/vagrant/.rvm/gems/ruby-2.5.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:476:in `block in load_file'
/home/vagrant/.rvm/gems/ruby-2.5.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:661:in `new_constants_in'
/home/vagrant/.rvm/gems/ruby-2.5.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:475:in `load_file'
/home/vagrant/.rvm/gems/ruby-2.5.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:374:in `block in require_or_load'
/home/vagrant/.rvm/gems/ruby-2.5.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:36:in `block in load_i


Related issues

Is duplicate of Katello - Bug #24726: Make Katello Ruby 2.5 compliantClosed

History

#1 Updated by Rahul Bajaj about 2 years ago

This bug is due to using the ruby version 2.5, If ruby 2.4 is used everything works well.

This bug can be resolve by using syntax like(notice the brackets):

before_action(:only => [:create, :update]) { find_content_credential CONTENT_CREDENTIAL_GPG_KEY_TYPE }

instead of(notice the brackets):

before_action:only => [:create, :update] { find_content_credential CONTENT_CREDENTIAL_GPG_KEY_TYPE }

#3 Updated by Justin Sherrill about 2 years ago

  • Target version set to 160

#4 Updated by Jonathon Turel about 2 years ago

  • Legacy Backlogs Release (now unused) set to 349
  • Assignee set to Andrew Kofink

#5 Updated by Jonathon Turel almost 2 years ago

  • Triaged set to Yes
  • Target version changed from Katello 3.8.0 to Katello 3.9.0
  • Category changed from Hammer to API

#6 Updated by John Mitsch almost 2 years ago

  • Is duplicate of Bug #24726: Make Katello Ruby 2.5 compliant added

#7 Updated by John Mitsch almost 2 years ago

  • Status changed from New to Duplicate

Looks like this is a duplicate of the upgrade to ruby 2.5 issue that I linked. I can't reproduce so looks like it's been fixed by that change!

Also available in: Atom PDF