smart_proxy_remote_execution_ssh_core 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 596c8e37a9ec57f666acd9297a29fec7498adbdb
4
- data.tar.gz: 4cb5757f3fafaefb953c66a34f6df6f1e7c921fd
3
+ metadata.gz: a3d03a9b6dc59a61f903a45baa7de869c42060ae
4
+ data.tar.gz: 256ba3b25ba7507b321d72c4cf33bf60b2da216d
5
5
  SHA512:
6
- metadata.gz: 7b2e406e3fcbd73dfbb5184e27ffd221f920c7d7b15b568b90aa7b2cd4d07021e89434a8d0f732cb97bb7ae854eae5fba2db3550bb73e85713e1a9c9da932a77
7
- data.tar.gz: 04be83589282710e525409b0b1ac71cf77995ca586c1ba2da7893180d996d50284f8945c9279ded877d406aef7a372400301788a1b8fd412e78bd3b4c3b171d8
6
+ metadata.gz: 52be50f0fc05bbf3cb49ac669a0b7d3c09fbb42e095dad1754b343e26640f39d4bdd77c630186d8644eaf09e71efc866edfae2f6060fd74cb6f064c3aa5fa587
7
+ data.tar.gz: 98c556a55dcd3bf886cea75afcff3970158ab3dd240c1c6af77cb46656cee9568cd3259b55089bf98dbd4afc45591e44739c1ac30e2b60e3f3c4d93576a149de
@@ -20,9 +20,9 @@ module Proxy
20
20
  init_run
21
21
  when CommandUpdate
22
22
  process_update(event)
23
- when Dynflow::Action::Cancellable::Cancel
23
+ when ::Dynflow::Action::Cancellable::Cancel
24
24
  kill_run
25
- when Dynflow::Action::Skip
25
+ when ::Dynflow::Action::Skip
26
26
  # do nothing
27
27
  else
28
28
  raise "Unexpected event #{event.inspect}"
@@ -38,13 +38,14 @@ module Proxy
38
38
  end
39
39
 
40
40
  def rescue_strategy_for_self
41
- Dynflow::Action::Rescue::Skip
41
+ ::Dynflow::Action::Rescue::Skip
42
42
  end
43
43
 
44
44
  def command
45
45
  @command ||= Dispatcher::Command.new(:id => input[:task_id],
46
46
  :host => input[:hostname],
47
47
  :ssh_user => input[:ssh_user] || 'root',
48
+ :ssh_port => input[:ssh_port] || 22,
48
49
  :effective_user => input[:effective_user],
49
50
  :script => input[:script],
50
51
  :effective_user_method => input[:effective_user_method],
@@ -12,6 +12,7 @@ module Proxy
12
12
 
13
13
  def initialize(host, user, options = {})
14
14
  @host = host
15
+ @port = options[:port] || 22
15
16
  @user = user
16
17
  @logger = options[:logger] || Logger.new($stderr)
17
18
  @client_private_key_file = options[:client_private_key_file]
@@ -136,6 +137,7 @@ module Proxy
136
137
 
137
138
  def ssh_options
138
139
  ssh_options = {}
140
+ ssh_options[:port] = @port if @port
139
141
  ssh_options[:keys] = [@client_private_key_file] if @client_private_key_file
140
142
  ssh_options[:user_known_hosts_file] = @known_hosts_file if @known_hosts_file
141
143
  ssh_options[:keys_only] = true
@@ -9,7 +9,7 @@ module Proxy
9
9
  class Dispatcher < ::Dynflow::Actor
10
10
  # command comming from action
11
11
  class Command
12
- attr_reader :id, :host, :ssh_user, :effective_user, :effective_user_method, :script, :host_public_key, :suspended_action
12
+ attr_reader :id, :host, :ssh_user, :ssh_port, :effective_user, :effective_user_method, :script, :host_public_key, :suspended_action
13
13
 
14
14
  def initialize(data)
15
15
  validate!(data)
@@ -17,6 +17,7 @@ module Proxy
17
17
  @id = data[:id]
18
18
  @host = data[:host]
19
19
  @ssh_user = data[:ssh_user]
20
+ @ssh_port = data[:ssh_port]
20
21
  @effective_user = data[:effective_user]
21
22
  @effective_user_method = data[:effective_user_method] || 'su'
22
23
  @script = data[:script]
@@ -131,6 +131,7 @@ module Proxy
131
131
  options = { :logger => @logger }
132
132
  options[:known_hosts_file] = prepare_known_hosts
133
133
  options[:client_private_key_file] = @client_private_key_file
134
+ options[:port] = @command.ssh_port
134
135
  @connector = @connector_class.new(@command.host, @command.ssh_user, options)
135
136
  end
136
137
 
@@ -3,7 +3,7 @@ require 'ostruct'
3
3
  module Proxy
4
4
  module RemoteExecution
5
5
  module Ssh
6
- class Settings < OpenStruct
6
+ class Settings < SmartProxyDynflowCore::Settings
7
7
 
8
8
  DEFAULT_SETTINGS = {
9
9
  :enabled => true,
@@ -2,7 +2,7 @@ module Proxy
2
2
  module RemoteExecution
3
3
  module Ssh
4
4
  module Core
5
- VERSION = '0.1.2'
5
+ VERSION = '0.1.3'
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_remote_execution_ssh_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
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: 2016-06-13 00:00:00.000000000 Z
11
+ date: 2016-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
193
  version: '0'
194
194
  requirements: []
195
195
  rubyforge_project:
196
- rubygems_version: 2.4.8
196
+ rubygems_version: 2.4.5
197
197
  signing_key:
198
198
  specification_version: 4
199
199
  summary: Ssh remote execution provider for Foreman Smart-Proxy