smart_proxy_remote_execution_ssh 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/smart_proxy_remote_execution_ssh/command_update.rb +1 -0
- data/lib/smart_proxy_remote_execution_ssh/connector.rb +2 -10
- data/lib/smart_proxy_remote_execution_ssh/dispatcher.rb +2 -2
- data/lib/smart_proxy_remote_execution_ssh/plugin.rb +4 -1
- data/lib/smart_proxy_remote_execution_ssh/session.rb +4 -4
- data/lib/smart_proxy_remote_execution_ssh/version.rb +1 -1
- data/settings.d/remote_execution_ssh.yml.example +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 638dd025cee7176c1140d55daad36647756d2c86
|
4
|
+
data.tar.gz: a3bf4cd13dfaa4011f187fd2c14b2581aef6c317
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb4cc423186ca8dcd71cee29466be2c635219ac26eee9d36e6614471cc3c5f2eb33f6cd66f807db1d3d29e14517e5cd07632539d3f3fd98d70ae3d6db60aed94
|
7
|
+
data.tar.gz: 793edc8274aba67e83e4575fbb0cf1e724e8c79c7d16820e7ce338a7166993e5a3487f0537eb090987534fe74b02810815fef8d8ab466a08d6b957424a9e309a
|
@@ -22,9 +22,9 @@ module Proxy::RemoteExecution::Ssh
|
|
22
22
|
def async_run(command)
|
23
23
|
started = false
|
24
24
|
session.open_channel do |channel|
|
25
|
-
channel.on_data { |ch, data| yield CommandUpdate::StdoutData.new(
|
25
|
+
channel.on_data { |ch, data| yield CommandUpdate::StdoutData.new(data) }
|
26
26
|
|
27
|
-
channel.on_extended_data { |ch, type, data| yield CommandUpdate::StderrData.new(
|
27
|
+
channel.on_extended_data { |ch, type, data| yield CommandUpdate::StderrData.new(data) }
|
28
28
|
|
29
29
|
# standard exit of the command
|
30
30
|
channel.on_request("exit-status") { |ch, data| yield CommandUpdate::StatusData.new(data.read_long) }
|
@@ -120,14 +120,6 @@ module Proxy::RemoteExecution::Ssh
|
|
120
120
|
|
121
121
|
private
|
122
122
|
|
123
|
-
def handle_encoding(data)
|
124
|
-
if data.is_a? String
|
125
|
-
data.force_encoding('UTF-8')
|
126
|
-
else
|
127
|
-
data
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
123
|
def session
|
132
124
|
@session ||= begin
|
133
125
|
@logger.debug("opening session to #{@user}@#{@host}")
|
@@ -35,8 +35,8 @@ module Proxy::RemoteExecution::Ssh
|
|
35
35
|
@session_args = { :logger => @logger,
|
36
36
|
:clock => @clock,
|
37
37
|
:connector_class => options[:connector_class] || Connector,
|
38
|
-
:local_working_dir => options[:local_working_dir] ||
|
39
|
-
:remote_working_dir => options[:remote_working_dir] ||
|
38
|
+
:local_working_dir => options[:local_working_dir] || ::Proxy::RemoteExecution::Ssh::Plugin.settings.local_working_dir,
|
39
|
+
:remote_working_dir => options[:remote_working_dir] || ::Proxy::RemoteExecution::Ssh::Plugin.settings.remote_working_dir,
|
40
40
|
:client_private_key_file => Proxy::RemoteExecution::Ssh.private_key_file,
|
41
41
|
:refresh_interval => options[:refresh_interval] || 1 }
|
42
42
|
|
@@ -5,7 +5,10 @@ module Proxy::RemoteExecution::Ssh
|
|
5
5
|
|
6
6
|
settings_file "remote_execution_ssh.yml"
|
7
7
|
default_settings :ssh_identity_key_file => '~/.ssh/id_rsa_foreman_proxy',
|
8
|
-
:ssh_user
|
8
|
+
:ssh_user => 'root',
|
9
|
+
:remote_working_dir => '/var/tmp',
|
10
|
+
:local_working_dir => '/var/tmp'
|
11
|
+
|
9
12
|
plugin :ssh, Proxy::RemoteExecution::Ssh::VERSION
|
10
13
|
end
|
11
14
|
end
|
@@ -9,8 +9,8 @@ module Proxy::RemoteExecution::Ssh
|
|
9
9
|
@clock = options[:clock] || Dynflow::Clock.spawn('proxy-dispatcher-clock')
|
10
10
|
@logger = options[:logger] || Logger.new($stderr)
|
11
11
|
@connector_class = options[:connector_class] || Connector
|
12
|
-
@local_working_dir = options[:local_working_dir] ||
|
13
|
-
@remote_working_dir = options[:remote_working_dir] ||
|
12
|
+
@local_working_dir = options[:local_working_dir] || ::Proxy::RemoteExecution::Ssh::Plugin.settings.local_working_dir
|
13
|
+
@remote_working_dir = options[:remote_working_dir] || ::Proxy::RemoteExecution::Ssh::Plugin.settings.remote_working_dir
|
14
14
|
@refresh_interval = options[:refresh_interval] || 1
|
15
15
|
@client_private_key_file = Proxy::RemoteExecution::Ssh.private_key_file
|
16
16
|
@command = options[:command]
|
@@ -113,7 +113,7 @@ module Proxy::RemoteExecution::Ssh
|
|
113
113
|
end
|
114
114
|
|
115
115
|
def local_command_dir
|
116
|
-
File.join(@local_working_dir, @command.id)
|
116
|
+
File.join(@local_working_dir, 'foreman-proxy', "foreman-ssh-cmd-#{@command.id}")
|
117
117
|
end
|
118
118
|
|
119
119
|
def local_command_file(filename)
|
@@ -121,7 +121,7 @@ module Proxy::RemoteExecution::Ssh
|
|
121
121
|
end
|
122
122
|
|
123
123
|
def remote_command_dir
|
124
|
-
File.join(@remote_working_dir, @command.id)
|
124
|
+
File.join(@remote_working_dir, "foreman-ssh-cmd-#{@command.id}")
|
125
125
|
end
|
126
126
|
|
127
127
|
def remote_command_file(filename)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_proxy_remote_execution_ssh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Nečas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|