uoregon-multissh 0.3.3 → 0.3.4
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/cli.rb +27 -20
- data/uoregon-multissh.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '097fb0d438ad8612a245a114c4a0a0ea83ca4ef4ba805991bc89ac5d07214947'
|
4
|
+
data.tar.gz: 0b962624d18475092a037a59c34d8680d0c7ed799c4441ebaee692723c5afcc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da3a07426ac6106e01434cd93a7bb8bb62523ea2d9cc6d22578de9c9a35bbcb8b7b630a6a22409c6ca5bbe291200f82504443f2baf6ef32e0fc76f9503cd8a2b
|
7
|
+
data.tar.gz: 97a9c74220b38105b4bba788b7deef67fc5803b12285c11f850b0af8f0e741504ca7e6f48332164307df8039552ebacbb205d65e3e26624ac374276006b5d00e
|
data/lib/cli.rb
CHANGED
@@ -35,6 +35,7 @@ class Cli
|
|
35
35
|
@pkey_password = @options[:pkey_password]
|
36
36
|
|
37
37
|
@debug = true if @options[:debug]
|
38
|
+
@util = Util.new(@debug)
|
38
39
|
@regenerate = true if @options[:regenerate_config]
|
39
40
|
@disable_sudo = true if @options[:disable_sudo]
|
40
41
|
|
@@ -67,20 +68,23 @@ class Cli
|
|
67
68
|
# If '@' is used, return a list of nodes from a file
|
68
69
|
# Otherwise return a list of nodes parsed from comma-separated input from cli
|
69
70
|
#
|
71
|
+
@util.dbg("nodes: #{nodes}")
|
70
72
|
if nodes.start_with?('@')
|
71
73
|
node_list = []
|
72
74
|
file_path = nodes[1..-1]
|
73
75
|
expanded_file_path = File.expand_path(file_path)
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
76
|
+
@util.dbg("nodes_file: #{expanded_file_path}")
|
77
|
+
raise "File not found" unless File.exists?(expanded_file_path)
|
78
|
+
|
79
|
+
File.open(expanded_file_path, 'r') do |f|
|
80
|
+
f.each_line do |line|
|
81
|
+
line.chomp!.strip!
|
82
|
+
unless line.start_with?('#') || line.empty?
|
83
|
+
node_list << line
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
84
88
|
return node_list
|
85
89
|
else
|
86
90
|
return nodes.split(',').map(&:strip)
|
@@ -93,20 +97,23 @@ class Cli
|
|
93
97
|
# If '@' is used, return a command string from a file
|
94
98
|
# Otherwise return specified command
|
95
99
|
#
|
100
|
+
@util.dbg("command: #{command}")
|
96
101
|
if command.start_with?('@')
|
97
102
|
command_list = []
|
98
103
|
file_path = command[1..-1]
|
99
104
|
expanded_file_path = File.expand_path(file_path)
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
105
|
+
@util.dbg("command_file: #{expanded_file_path}")
|
106
|
+
raise "File not found" unless File.exists?(expanded_file_path)
|
107
|
+
|
108
|
+
File.open(expanded_file_path, 'r') do |f|
|
109
|
+
f.each_line do |line|
|
110
|
+
line.chomp!.strip!
|
111
|
+
unless line.start_with?('#') || line.empty?
|
112
|
+
command_list << line
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
110
117
|
command_list.map! do |command|
|
111
118
|
command = format_command(command, @disable_sudo)
|
112
119
|
end
|
data/uoregon-multissh.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'uoregon-multissh'
|
3
|
-
spec.version = '0.3.
|
3
|
+
spec.version = '0.3.4'
|
4
4
|
spec.date = '2019-05-14'
|
5
5
|
spec.summary = "Do all the things everywhere at the same time"
|
6
6
|
spec.description = "Quickly run multiple commands on many boxes at the same time"
|