Skip to content

Commit

Permalink
inspec-compliance: url_encode profile names
Browse files Browse the repository at this point in the history
  • Loading branch information
srenatus authored and arlimus committed Mar 24, 2016
1 parent 62cadd0 commit be93f25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/bundles/inspec-compliance/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# author: Dominik Richter

require 'thor'
require 'erb'

module Compliance
class ComplianceCLI < Inspec::BaseCLI # rubocop:disable Metrics/ClassLength
Expand Down Expand Up @@ -106,9 +107,10 @@ def upload(path) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Percei
end

puts "Start upload to #{owner}/#{profile_name}"
pname = ERB::Util.url_encode(profile_name)

# upload the tar to Chef Compliance
url = "#{config['server']}/owners/#{owner}/compliance/#{profile_name}/tar"
url = "#{config['server']}/owners/#{owner}/compliance/#{pname}/tar"

puts "Uploading to #{url}"
success, msg = Compliance::API.post_file(url, config['token'], '', archive_path, config['insecure'])
Expand Down

0 comments on commit be93f25

Please sign in to comment.