brpm_content_framework 0.2.52 → 0.2.53
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/config.yml +1 -1
- data/lib/brpm_auto.rb +0 -6
- data/lib/utilities.rb +18 -9
- data/transport/dispatch_base.rb +1 -1
- data/transport/transport_nsh.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjU3ZTAxNWFiMGNjYTJlMjI0NzQ0ZmMzZjRiYTY3Yzg3ODRkNTc5Zg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MDBlMTBhOTE4MWEwNDlhNGFmMWU4NzNmMDQ5YmYwOTYwNWZmN2IyNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjQ5OWRlYTEwZDEzZTg0ZmQ2Zjg2ZTRhZmViOTExODM3NTFjZThmMWZjZWM4
|
10
|
+
ZTcwZTNjZjUzZDU5YzVjNjdhNWZkNDM5MzJkMmY0ZmJlNmU0OTgxZDQ4ZWU4
|
11
|
+
YjQxNDFhMjEyNmY2OTNlYzdkOWJjZjM4NjQ4MDMwNGE1MzgwNmM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGY2NjJmOWI1M2YzZWFjYTEyYTQyNDBmODAxZGU0YTNmZjU4NWU3NjY3MjY3
|
14
|
+
NzczYWE4ZmE2YWIyODFjZjc0Y2FlMDRiNzVlZWY1YThiN2ViOWI0NmQ3ODQ5
|
15
|
+
ZmQ5ZTRiZGNjMzE1NDNjZTcwYTRlOGZmN2JkY2M1MDI1OWJiMzk=
|
data/config.yml
CHANGED
data/lib/brpm_auto.rb
CHANGED
@@ -105,12 +105,6 @@ class BrpmAuto
|
|
105
105
|
@logger = SimpleLogger.new(log_file, also_log_to_console)
|
106
106
|
end
|
107
107
|
|
108
|
-
def is_windows?
|
109
|
-
require 'rbconfig'
|
110
|
-
|
111
|
-
RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/i
|
112
|
-
end
|
113
|
-
|
114
108
|
def run_from_brpm
|
115
109
|
@params.run_from_brpm
|
116
110
|
end
|
data/lib/utilities.rb
CHANGED
@@ -1,9 +1,18 @@
|
|
1
|
+
require 'rbconfig'
|
1
2
|
require 'open3'
|
2
3
|
|
3
4
|
module Utilities
|
4
5
|
EXIT_CODE_FAILURE = 'Exit_Code_Failure'
|
5
|
-
|
6
|
-
|
6
|
+
|
7
|
+
def is_windows?
|
8
|
+
RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/i
|
9
|
+
end
|
10
|
+
|
11
|
+
def is_jruby?
|
12
|
+
|
13
|
+
RbConfig::CONFIG['ruby_install_name'] =~ /jruby/i
|
14
|
+
end
|
15
|
+
|
7
16
|
# Returns the dos path from a standard path
|
8
17
|
#
|
9
18
|
# ==== Attributes
|
@@ -47,7 +56,7 @@ module Utilities
|
|
47
56
|
|
48
57
|
output_dir = File.join(BrpmAuto.params.output_dir,"#{precision_timestamp}")
|
49
58
|
errfile = "#{output_dir}_stderr.txt"
|
50
|
-
complete_command = "#{escaped_command} 2>#{errfile}" unless
|
59
|
+
complete_command = "#{escaped_command} 2>#{errfile}" unless is_windows?
|
51
60
|
fil = File.open(errfile, "w+")
|
52
61
|
fil.close
|
53
62
|
|
@@ -78,7 +87,11 @@ module Utilities
|
|
78
87
|
cmd_result
|
79
88
|
end
|
80
89
|
|
81
|
-
def execute_command(
|
90
|
+
def execute_command(command)
|
91
|
+
*commands=command
|
92
|
+
if is_jruby? #TODO work around for buggy jruby implementation of popen3
|
93
|
+
*commands = RbConfig::CONFIG['SHELL'], is_windows? ? "?C" : "-c", command
|
94
|
+
end
|
82
95
|
Open3.popen3(*commands) do |stdin, stdout, stderr, thread|
|
83
96
|
logs = {:out => "", :err => ""}
|
84
97
|
|
@@ -280,10 +293,6 @@ module Utilities
|
|
280
293
|
result
|
281
294
|
end
|
282
295
|
|
283
|
-
def windows?
|
284
|
-
Windows
|
285
|
-
end
|
286
|
-
|
287
296
|
def privatize(expression, sensitive_data = BrpmAuto.params.private_params.values)
|
288
297
|
unless sensitive_data.nil? or sensitive_data.empty?
|
289
298
|
sensitive_data = [sensitive_data] if sensitive_data.kind_of?(String)
|
@@ -330,7 +339,7 @@ module Utilities
|
|
330
339
|
|
331
340
|
#TODO: still needed? the framework's error handling should take care of this already
|
332
341
|
def exit_code_failure
|
333
|
-
return "" if
|
342
|
+
return "" if is_windows?
|
334
343
|
size_ = EXIT_CODE_FAILURE.size
|
335
344
|
exit_code_failure_first_part = EXIT_CODE_FAILURE[0..3]
|
336
345
|
exit_code_failure_second_part = EXIT_CODE_FAILURE[4..size_]
|
data/transport/dispatch_base.rb
CHANGED
@@ -291,7 +291,7 @@ class DispatchBase
|
|
291
291
|
instance_path = File.join(staging_path, package_file)
|
292
292
|
staging_artifacts = Dir.entries(staging_path).reject{|k| [".",".."].include?(k) }
|
293
293
|
return {"instance_path" => "ERROR - no files in staging area", "md5" => ""} if staging_artifacts.size < 1
|
294
|
-
cmd = "cd #{staging_path} && zip -r #{package_file} *" unless
|
294
|
+
cmd = "cd #{staging_path} && zip -r #{package_file} *" unless BrpmAuto.is_windows?
|
295
295
|
result = execute_shell(cmd)
|
296
296
|
md5 = Digest::MD5.file(instance_path).hexdigest
|
297
297
|
{"instance_path" => instance_path, "md5" => md5, "manifest" => staging_artifacts}
|
data/transport/transport_nsh.rb
CHANGED
@@ -186,7 +186,7 @@ class TransportNSH
|
|
186
186
|
err_file = touch_file("#{script_dir}/nsh_errors_#{Time.now.strftime("%Y%m%d%H%M%S%L")}.txt")
|
187
187
|
script_path = "\"#{script_path}\"" if script_path.include?(" ")
|
188
188
|
cmd = "#{nsh_cmd("scriptutil")} -d \"#{nsh_path(target_path)}\" -h #{target_hosts.join(" ")} -s #{script_path}"
|
189
|
-
cmd = cmd + " 2>#{err_file}" unless BrpmAuto.
|
189
|
+
cmd = cmd + " 2>#{err_file}" unless BrpmAuto.is_windows?
|
190
190
|
result = execute_shell(cmd)
|
191
191
|
result["stderr"] = "#{result["stderr"]}\n#{File.open(err_file).read}"
|
192
192
|
result = display_result(result) unless raw_result
|
@@ -353,7 +353,7 @@ class TransportNSH
|
|
353
353
|
|
354
354
|
def platform_temp
|
355
355
|
res = "/tmp"
|
356
|
-
res = "C:/Windows/temp" if BrpmAuto.
|
356
|
+
res = "C:/Windows/temp" if BrpmAuto.is_windows?
|
357
357
|
res
|
358
358
|
end
|
359
359
|
end
|