foreman_remote_execution_core 1.0.1 → 1.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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 226b786aad451e66300cd835bd15142874a9c9d1
4
- data.tar.gz: d2a0352db0975d68d2aed2be9d8788d1e5cfbd51
3
+ metadata.gz: 40dc9b4977c799a3f8ad7bccb38fc4b8cc32134b
4
+ data.tar.gz: 5ae9fe01a1989c2d2cfc9d68d4eae023e5cdc903
5
5
  SHA512:
6
- metadata.gz: 3f902ef6528aca3472ada120672c49391295216b78c62c76b557141c7922b603b66b3912ce32ca38875eb753ab052211354b33e048eaae2a67e548b9206e40d4
7
- data.tar.gz: 96970c70446c27a96404b1c748c514e2bad7683ecb4229a3047cbbb269481768f433327d9c9571a0f8264ec4703a054b1a19e0ef898f5766ade3557477b8c97a
6
+ metadata.gz: 6b3c4731a69062ca30bbc023abe2aed22f2e9be5d7ab7e067fc8c14133cb57c16f5fe70c4bceaf10abafe9717755139e246f470e08e28ba69f67b6aeb711be50
7
+ data.tar.gz: da984876ee96f01b82d2b6f53091e8346a5a87863cb6235b35d5cb7f145bde1b99a9e99765cba67fe4cd922c655082daa8db02b81f028e4b2c26e4e766ba93e4
@@ -24,14 +24,14 @@ module ForemanRemoteExecutionCore
24
24
  def start
25
25
  remote_script = cp_script_to_remote
26
26
  output_path = File.join(File.dirname(remote_script), 'output')
27
+ exit_code_path = File.join(File.dirname(remote_script), 'exit_code')
27
28
 
28
- # pipe the output to tee while capturing the exit code
29
+ # pipe the output to tee while capturing the exit code in a file
29
30
  script = <<-SCRIPT
30
- exec 4>&1
31
- exit_code=`((#{su_prefix}#{remote_script}; echo $?>&3 ) | /usr/bin/tee #{output_path} ) 3>&1 >&4`
32
- exec 4>&-
33
- exit $exit_code
31
+ (#{su_prefix}#{remote_script}; echo $?>#{exit_code_path}) | /usr/bin/tee #{output_path}
32
+ exit $(< #{exit_code_path})
34
33
  SCRIPT
34
+
35
35
  logger.debug("executing script:\n#{script.lines.map { |line| " | #{line}" }.join}")
36
36
  run_async(script)
37
37
  rescue => e
@@ -1,3 +1,3 @@
1
1
  module ForemanRemoteExecutionCore
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_remote_execution_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.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: 2016-09-12 00:00:00.000000000 Z
11
+ date: 2016-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreman-tasks-core