smart_proxy_remote_execution_ssh 0.0.1 → 0.0.2

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWNiMzQ5YmI2NGRmYjg3MGNiMzkyNzdkN2RjZDk0OWM1NmE1NDRkNw==
4
+ ZjdmZmFmMmM4MTJkMGFiYzQzNThkM2ZmMmE0YTVkM2IxNWZjNTYyZg==
5
5
  data.tar.gz: !binary |-
6
- ZWNjNzg4NjFkODY2MTkwZmM4ZWMzMTJlOTY4MzFmZjIwZDA3ZGM2ZQ==
6
+ MGM5M2MwYWEzOTI5Zjk0NzBiZDQ5N2IyZjFlMTQwYWQzNzUyNDM4Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTdmZDEzMjJlYzViOGU4MjhiMzFjODA2YzVhM2FjMTg5MWE0ODI0OWI1YWFl
10
- YjI4OTZmMTg5ZmUwYjgyYmE2NGNmM2ZkMTQ0NjY3YWQwYTZlNmNiMWU1ZWE1
11
- YTgyY2EzOWJkZDJmNTU1Y2I4YTBhM2JjOTY1ZTkwODA0YjM2YWY=
9
+ N2Q3ZTUwNTdmOTA2ZGNhYjYxYjY1Nzc3YmIwY2U0OWE2NTE5M2JiMjRkYzUz
10
+ MjM5NzI3MmQ4Y2I3ZmU0MDZiY2JjN2Y5ZDliZjUwYWI4NWY2MGUzMjhkZjg5
11
+ NzFkNWJhYzNiOGY1ZDc4YjYwMWE2NTRjYjgyMGViYzIyNjAxOTc=
12
12
  data.tar.gz: !binary |-
13
- ZjQyMDM1ZWQ4YjVmNTBiOWM2Y2YwMzZhNzZmNDNjNzdiODZmNzViMGVmZTQ0
14
- NzU3YzcyMDVlOTU2ODQ3OTVjZWQ5MjVmYjQ4ODBlMWZiNTFiMWNkNjgzNGFi
15
- YTcyZWY3NjFjODkzMWYzODU3YjdjNTRmZGEzMzlhMjA4ZDNmODk=
13
+ NzkxYmY2NzViOGNkMzYyZjJkZWY4ZTJiYmJkNzk3YTA2MTBlMGQ4NmIwYTgw
14
+ ODI3ZjUyMzZmN2E2MjVkYzk4ZTQ1YmVhMzBkYjk0ODkyNzczZWMyOGRkZTAz
15
+ OGY5YzY2ZDE4NzNiOTI0MzkwOGUxZDFkYTBmZDQ3OGFlNzViNzk=
@@ -31,6 +31,10 @@ module Proxy::RemoteExecution::Ssh
31
31
  else
32
32
  raise "Unexpected event #{event.inspect}"
33
33
  end
34
+ rescue => e
35
+ action_logger.error e
36
+ output[:result] << Connector::DebugData.new("#{e.class}: #{e.message}").to_hash
37
+ output[:exit_status] = "PROXY_ERROR"
34
38
  end
35
39
 
36
40
  def finalize
@@ -17,6 +17,12 @@ module Proxy::RemoteExecution::Ssh
17
17
  def data_type
18
18
  raise NotImplemented
19
19
  end
20
+
21
+ def to_hash
22
+ { :output_type => data_type,
23
+ :output => data,
24
+ :timestamp => timestamp.to_f }
25
+ end
20
26
  end
21
27
 
22
28
  class StdoutData < Data
@@ -38,11 +38,7 @@ module Proxy::RemoteExecution::Ssh
38
38
  end
39
39
 
40
40
  def buffer_to_hash
41
- buffer.map do |buffer_data|
42
- { :output_type => buffer_data.data_type,
43
- :output => buffer_data.data,
44
- :timestamp => buffer_data.timestamp.to_f }
45
- end
41
+ buffer.map(&:to_hash)
46
42
  end
47
43
  end
48
44
 
@@ -7,9 +7,5 @@ module Proxy::RemoteExecution::Ssh
7
7
  default_settings :ssh_identity_key_file => '~/.ssh/id_rsa_foreman_proxy',
8
8
  :ssh_user => 'root'
9
9
  plugin :ssh, Proxy::RemoteExecution::Ssh::VERSION
10
-
11
- after_activation do
12
- Proxy::RemoteExecution::Ssh.initialize
13
- end
14
10
  end
15
11
  end
@@ -1,7 +1,7 @@
1
1
  module Proxy
2
2
  module RemoteExecution
3
3
  module Ssh
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
5
5
  end
6
6
  end
7
7
  end
@@ -11,8 +11,6 @@ require 'smart_proxy_remote_execution_ssh/api'
11
11
  module Proxy::RemoteExecution
12
12
  module Ssh
13
13
  class << self
14
- attr_reader :dispatcher
15
-
16
14
  def initialize
17
15
  unless private_key_file
18
16
  raise "settings for `ssh_identity_key` not set"
@@ -32,6 +30,10 @@ module Proxy::RemoteExecution
32
30
  :logger => Proxy::Dynflow.instance.world.logger)
33
31
  end
34
32
 
33
+ def dispatcher
34
+ @dispatcher || initialize
35
+ end
36
+
35
37
  def private_key_file
36
38
  File.expand_path(Ssh::Plugin.settings.ssh_identity_key_file)
37
39
  end
@@ -42,3 +44,5 @@ module Proxy::RemoteExecution
42
44
  end
43
45
  end
44
46
  end
47
+
48
+ Proxy::Dynflow.after_initialize { Proxy::RemoteExecution::Ssh.initialize }
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.1
4
+ version: 0.0.2
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-08-13 00:00:00.000000000 Z
11
+ date: 2015-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - ~>
116
116
  - !ruby/object:Gem::Version
117
- version: 0.0.1
117
+ version: 0.0.3
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ~>
123
123
  - !ruby/object:Gem::Version
124
- version: 0.0.1
124
+ version: 0.0.3
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: net-ssh
127
127
  requirement: !ruby/object:Gem::Requirement