From a4a8b6393da5a1bab3586713fcefc4a4fac1ef6a Mon Sep 17 00:00:00 2001 From: yqbk Date: Tue, 24 May 2016 15:59:10 +0200 Subject: [PATCH] test creates the workspace files repaired --- lib/docker_client.rb | 6 ++++-- lib/xikolo/client.rb | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/docker_client.rb b/lib/docker_client.rb index 80986377..cd3a4557 100644 --- a/lib/docker_client.rb +++ b/lib/docker_client.rb @@ -23,7 +23,7 @@ class DockerClient def self.clean_container_workspace(container) # remove files when using transferral via Docker API archive_in (transmit) #container.exec(['bash', '-c', 'rm -rf ' + CONTAINER_WORKSPACE_PATH + '/*']) - + local_workspace_path = local_workspace_path(container) if local_workspace_path && Pathname.new(local_workspace_path).exist? Pathname.new(local_workspace_path).children.each{ |p| p.rmtree} @@ -69,10 +69,12 @@ class DockerClient # todo separate stderr query_params = 'logs=0&stream=1&' + (stderr ? 'stderr=1' : 'stdout=1&stdin=1') + client_params = DockerClient.config['host'] + '/containers/' + @container.id + '/attach/ws?' + query_params + # Headers are required by Docker headers = {'Origin' => 'http://localhost'} - socket = Faye::WebSocket::Client.new(DockerClient.config['ws_host'] + '/containers/' + @container.id + '/attach/ws?' + query_params, [], :headers => headers) + socket = Faye::WebSocket::Client.new(client_params, [], :headers => headers) socket.on :error do |event| Rails.logger.info "Websocket error: " + event.message diff --git a/lib/xikolo/client.rb b/lib/xikolo/client.rb index 06e4ecf4..eabb7126 100644 --- a/lib/xikolo/client.rb +++ b/lib/xikolo/client.rb @@ -1,4 +1,4 @@ -class Xikolo::Client +class Xikolo::3Client def self.get_user(user_id) params = {:user_id => user_id} response = get_request(user_profile_url(user_id), params)