Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions oc-chef-pedant/lib/pedant/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
require "rest_client"
require "mixlib/shellout" unless defined?(Mixlib::ShellOut)
require "uuidtools"
require "pedant/config"

Check failure on line 25 in oc-chef-pedant/lib/pedant/request.rb

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Move this 'require' statement to the top of the file before any class or module definitions.

See more on https://sonarcloud.io/project/issues?id=chef_chef-server&issues=AZqmHhkMGj93g3KvcUAX&open=AZqmHhkMGj93g3KvcUAX&pullRequest=4123
include Pedant::JSON

# TODO: alternative suggestions?
Expand All @@ -36,8 +37,7 @@

# Grab the the version of Chef / Knife that's on the box in order
# to properly set the X-Chef-Version header
KNIFE_VERSION = "18.8.46" # This version should be updated manually to point to valid chef release.
# FYI, this must be a valid, shipping version of Chef, or the server will reject requests.
KNIFE_VERSION = Pedant::Config.knife_version

# Headers that are added to all requests
def standard_headers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,6 @@ role "<%= @role %>"

include_version_in_status <%= node['private_chef']['opscode-erchef']['include_version_in_status'] %>
include_x_ops_api_info <%= node['private_chef']['opscode-erchef']['include_x_ops_api_info'] %>

# Chef/knife version number required in request.rb
knife_version "18.8.46" # Bump this as needed
Loading