test creates the workspace files repaired

This commit is contained in:
yqbk
2016-05-24 15:59:10 +02:00
parent 2564041378
commit a4a8b6393d
2 changed files with 5 additions and 3 deletions

View File

@ -23,7 +23,7 @@ class DockerClient
def self.clean_container_workspace(container) def self.clean_container_workspace(container)
# remove files when using transferral via Docker API archive_in (transmit) # remove files when using transferral via Docker API archive_in (transmit)
#container.exec(['bash', '-c', 'rm -rf ' + CONTAINER_WORKSPACE_PATH + '/*']) #container.exec(['bash', '-c', 'rm -rf ' + CONTAINER_WORKSPACE_PATH + '/*'])
local_workspace_path = local_workspace_path(container) local_workspace_path = local_workspace_path(container)
if local_workspace_path && Pathname.new(local_workspace_path).exist? if local_workspace_path && Pathname.new(local_workspace_path).exist?
Pathname.new(local_workspace_path).children.each{ |p| p.rmtree} Pathname.new(local_workspace_path).children.each{ |p| p.rmtree}
@ -69,10 +69,12 @@ class DockerClient
# todo separate stderr # todo separate stderr
query_params = 'logs=0&stream=1&' + (stderr ? 'stderr=1' : 'stdout=1&stdin=1') 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 are required by Docker
headers = {'Origin' => 'http://localhost'} 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| socket.on :error do |event|
Rails.logger.info "Websocket error: " + event.message Rails.logger.info "Websocket error: " + event.message

View File

@ -1,4 +1,4 @@
class Xikolo::Client class Xikolo::3Client
def self.get_user(user_id) def self.get_user(user_id)
params = {:user_id => user_id} params = {:user_id => user_id}
response = get_request(user_profile_url(user_id), params) response = get_request(user_profile_url(user_id), params)