Skip to content

Commit

Permalink
Merge pull request Katello#86 from thomasmckay/wait-task
Browse files Browse the repository at this point in the history
waits for remote content-host task
  • Loading branch information
thomasmckay committed May 27, 2015
2 parents 44af8d4 + 780e508 commit 17561af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
3 changes: 3 additions & 0 deletions lib/hammer_cli_csv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
require 'hammer_cli/exit_codes'

module HammerCLICsv
require 'hammer_cli_foreman'
require 'hammer_cli_foreman_tasks'

require 'hammer_cli_csv/base'
require 'hammer_cli_csv/exception_handler'

Expand Down
16 changes: 5 additions & 11 deletions lib/hammer_cli_csv/content_hosts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
# have received a copy of GPLv2 along with this software; if not, see
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.

require 'hammer_cli'
require 'json'
require 'csv'
require 'uri'

module HammerCLICsv
class CsvCommand
class ContentHostsCommand < BaseCommand
include ::HammerCLIForemanTasks::Helper

command_name 'content-hosts'
desc 'import or export content hosts'

Expand Down Expand Up @@ -167,12 +164,9 @@ def import
end

def import_remotely
@api.resource(:csv).call(:import_content_hosts, {
'content' => ::File.new(::File.expand_path(option_csv_file), 'rb')
}, {
:content_type => 'multipart/form-data',
:multipart => true
})
params = {'content' => ::File.new(::File.expand_path(option_csv_file), 'rb')}
headers = {:content_type => 'multipart/form-data', :multipart => true}
task_progress(@api.resource(:csv).call(:import_content_hosts, params, headers))
end

def import_locally
Expand Down

0 comments on commit 17561af

Please sign in to comment.