loom-core 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +31 -0
  3. data/Gemfile.lock +19 -1
  4. data/Rakefile +2 -0
  5. data/bin/loom +3 -0
  6. data/docs/architecture.jpg +0 -0
  7. data/gentags.sh +2 -0
  8. data/lib/loom/all.rb +1 -1
  9. data/lib/loom/config.rb +1 -1
  10. data/lib/loom/mods/mod_loader.rb +7 -2
  11. data/lib/loom/pattern/all.rb +1 -0
  12. data/lib/loom/pattern/definition_context.rb +4 -4
  13. data/lib/loom/pattern/dsl.rb +176 -119
  14. data/lib/loom/pattern/expanding_reference.rb +88 -6
  15. data/lib/loom/pattern/loader.rb +1 -17
  16. data/lib/loom/pattern/pattern.rb +52 -0
  17. data/lib/loom/pattern/reference.rb +17 -13
  18. data/lib/loom/pattern/reference_set.rb +71 -50
  19. data/lib/loom/runner.rb +46 -33
  20. data/lib/loom/runner/all.rb +2 -0
  21. data/lib/loom/runner/execution_context.rb +9 -0
  22. data/lib/loom/{dsl.rb → runner/sshkit_connector.rb} +5 -7
  23. data/lib/loom/shell.rb +4 -2
  24. data/lib/loom/shell/core.rb +16 -16
  25. data/lib/loom/version.rb +1 -1
  26. data/lib/loomext/coremods/exec.rb +1 -0
  27. data/loom.TAGS +797 -0
  28. data/loom.gemspec +1 -0
  29. data/spec/.loom/error_handling.loom +1 -0
  30. data/spec/.loom/fail.loom +27 -13
  31. data/spec/.loom/files.loom +1 -0
  32. data/spec/.loom/inventory.yml +3 -0
  33. data/spec/.loom/net.loom +1 -0
  34. data/spec/.loom/pattern_context.loom +1 -0
  35. data/spec/.loom/pkg.loom +1 -0
  36. data/spec/.loom/shell.loom +1 -0
  37. data/spec/.loom/test.loom +17 -4
  38. data/spec/.loom/user.loom +1 -0
  39. data/spec/.loom/vms.loom +1 -0
  40. data/spec/loom/pattern/dsl_spec.rb +3 -2
  41. data/spec/shared/loom_internals_helper.rb +1 -1
  42. data/spec/test_loom_spec.rb +102 -42
  43. data/test +15 -0
  44. metadata +25 -3
@@ -1,10 +1,13 @@
1
1
  module Loom
2
+ # TODO: Make Loom::Runner a module and move this to
3
+ # Loom::Runner::Core. Loom::RunnerModule is set up as a temporary namespace
4
+ # until that happens.
2
5
  class Runner
3
6
 
4
7
  PatternExecutionError = Class.new Loom::LoomError
5
8
  FailFastExecutionError = Class.new PatternExecutionError
6
9
 
7
- include Loom::DSL
10
+ include Loom::RunnerModule::SSHKitConnector
8
11
 
9
12
  def initialize(loom_config, pattern_slugs=[], other_facts={})
10
13
  @pattern_slugs = pattern_slugs
@@ -73,11 +76,13 @@ module Loom
73
76
  exit 97
74
77
  rescue Loom::LoomError => e
75
78
  Loom.log.error "Loom::LoomError => #{e.inspect}, run with -d for more"
76
- Loom.log.debug e.cause.backtrace.join "\n\t"
79
+ backtrace = e.cause.nil? ? e.backtrace : e.cause.backtrace
80
+ Loom.log.debug backtrace.join "\n\t"
81
+ Loom.log.debug backtrace.join "\n\t"
77
82
  exit 98
78
83
  rescue => e
79
- Loom.log.fatal "fatal error => #{e.inspect}"
80
- Loom.log.fatal e.backtrace.join "\n\t"
84
+ # TODO: Make error/exception logging look like this everywhere
85
+ Loom.log.fatal "fatal error =>\n#{e.inspect}\n\t#{e.backtrace.join("\n\t\t")}"
81
86
 
82
87
  loom_files = @loom_config.files.loom_files
83
88
  loom_errors = e.backtrace.select { |line| line =~ /(#{loom_files.join("|")})/ }
@@ -119,7 +124,7 @@ module Loom
119
124
  @pattern_refs = pattern_loader.patterns @pattern_slugs
120
125
 
121
126
  @loom_config[:loomfile_autoloads].each do |path|
122
- Loom.log.debug { "autoloading: #{path}" }
127
+ Loom.log.debug { "requiring config[:loomfile_autoloads]: #{path}" }
123
128
  require path
124
129
  end
125
130
  @mod_loader = Loom::Mods::ModLoader.new @loom_config
@@ -135,40 +140,18 @@ module Loom
135
140
 
136
141
  begin
137
142
  @pattern_refs.each do |pattern_ref|
138
- slug = pattern_ref.slug
139
- pattern_description = "[#{hostname} => #{slug}]"
140
-
141
143
  if @caught_sig_int
142
- Loom.log.warn "caught SIGINT, skipping #{pattern_description}"
144
+ Loom.log.warn "caught SIGINT, skipping #{log_token(pattern_ref, hostname)}"
143
145
  next
144
146
  elsif inventory_list.disabled? hostname
145
147
  Loom.log.warn "host disabled due to previous failure, " +
146
- "skipping: #{pattern_description}"
148
+ "skipping: #{log_token(pattern_ref, hostname)}"
147
149
  next
148
150
  end
149
151
 
150
- Loom.log.debug "collecting facts for => #{pattern_description}"
151
- # Collects facts for each pattern run on each host, this way if one
152
- # pattern run updates would be facts, the next pattern will see the
153
- # new fact.
154
- fact_shell = Loom::Shell.create @mod_loader, sshkit_backend, dry_run
155
- fact_set = Loom::Facts.fact_set(host_spec, fact_shell, @loom_config)
156
- .merge @other_facts
157
-
158
- Loom.log.info "running pattern => #{pattern_description}"
159
- # Creates a new shell for executing the pattern, so as not to be
160
- # tainted by the fact finding shell above.
161
- pattern_shell = Loom::Shell.create @mod_loader, sshkit_backend, dry_run
162
-
163
- Loom.log.warn "dry run only => #{pattern_description}" if dry_run
164
- failures = execute_pattern pattern_ref, pattern_shell, fact_set
165
-
166
- if failures.empty?
167
- Loom.log.debug "success on => #{pattern_description}"
168
- else
169
- Loom.log.error "failures on => #{pattern_description}:\n\t%s" % (
170
- failures.join("\n\t"))
171
- end
152
+ # wip-patternbuilder is adding this feature
153
+ # run_analysis_phase(pattern_ref, host_spec, sshkit_backend)
154
+ run_execution_phase(pattern_ref, host_spec, sshkit_backend, dry_run)
172
155
  end
173
156
  rescue IOError => e
174
157
  # TODO: Try to patch SSHKit for a more specific error for unexpected
@@ -184,6 +167,32 @@ module Loom
184
167
  end
185
168
  end
186
169
 
170
+ def run_execution_phase(pattern_ref, host_spec, sshkit_backend, dry_run)
171
+ log_token = log_token(pattern_ref, host_spec.hostname)
172
+ Loom.log.debug "collecting facts for => #{log_token}"
173
+ # Collects facts for each pattern run on each host, this way if one
174
+ # pattern run updates would be facts, the next pattern will see the
175
+ # new fact.
176
+ fact_shell = Loom::Shell.create @mod_loader, sshkit_backend, dry_run
177
+ fact_set = Loom::Facts.fact_set(host_spec, fact_shell, @loom_config)
178
+ .merge @other_facts
179
+
180
+ Loom.log.info "running pattern => #{log_token}"
181
+ # Creates a new shell for executing the pattern, so as not to be
182
+ # tainted by the fact finding shell above.
183
+ pattern_shell = Loom::Shell.create @mod_loader, sshkit_backend, dry_run
184
+
185
+ Loom.log.warn "dry run only => #{log_token}" if dry_run
186
+ failures = execute_pattern pattern_ref, pattern_shell, fact_set
187
+
188
+ if failures.empty?
189
+ Loom.log.debug "success on => #{log_token}"
190
+ else
191
+ Loom.log.error "failures on => #{log_token}:\n\t%s" % (
192
+ failures.join("\n\t"))
193
+ end
194
+ end
195
+
187
196
  def execute_pattern(pattern_ref, shell, fact_set)
188
197
  shell_session = shell.session
189
198
  hostname = fact_set.hostname
@@ -218,7 +227,11 @@ module Loom
218
227
  run_failure
219
228
  end
220
229
 
221
- private
230
+ def log_token(pattern_ref, hostname)
231
+ slug = pattern_ref.slug
232
+ "[#{hostname} => #{slug}]"
233
+ end
234
+
222
235
  def handle_host_failure_strategy(hostname, failure_summary=nil)
223
236
  failure_strategy = @loom_config.run_failure_strategy.to_sym
224
237
 
@@ -0,0 +1,2 @@
1
+ require_relative "execution_context"
2
+ require_relative "sshkit_connector"
@@ -0,0 +1,9 @@
1
+ module Loom::RunnerModule
2
+ class ExecutionContext
3
+ attr_reader :module_accesses, :fact_sets
4
+
5
+ def initialize(shell_api)
6
+ end
7
+ end
8
+ end
9
+
@@ -5,12 +5,8 @@ require 'socket'
5
5
  # https://github.com/capistrano/sshkit/blob/master/lib/sshkit/backends/abstract.rb
6
6
  # https://github.com/capistrano/sshkit/blob/master/lib/sshkit/backends/netssh.rb
7
7
  # https://github.com/capistrano/sshkit/blob/master/lib/sshkit/backends/local.rb
8
- module Loom
9
-
10
- # TODO: Rename this to something like SSHKitWrapper, DSL is a
11
- # terribly misinformative name.
12
- module DSL
13
-
8
+ module Loom::RunnerModule
9
+ module SSHKitConnector
14
10
  UnexpectedHostError = Class.new Loom::LoomError
15
11
  SSHConnectionError = Class.new Loom::LoomError
16
12
 
@@ -22,7 +18,9 @@ module Loom
22
18
  # +&block+ should accept an SSHKit::Backend and SSHKit::Host
23
19
  def on_host(host_specs, &run_block)
24
20
  host_specs.each do |spec|
25
- raise UnexpectedHostError, "not a HostSpec => #{spec}" unless spec.is_a? HostSpec
21
+ unless spec.is_a? Loom::HostSpec
22
+ raise UnexpectedHostError "not a HostSpec => #{spec}"
23
+ end
26
24
  end
27
25
 
28
26
  host_spec_map = host_specs.reduce({}) do |map, spec|
@@ -3,8 +3,10 @@ module Loom
3
3
 
4
4
  VerifyError = Class.new Loom::LoomError
5
5
 
6
- def self.create(*args)
7
- Loom::Shell::Core.new *args
6
+ class << self
7
+ def create(mod_loader, sshkit_backend, dry_run, no_exec: false)
8
+ Loom::Shell::Core.new mod_loader, sshkit_backend, dry_run
9
+ end
8
10
  end
9
11
  end
10
12
  end
@@ -168,22 +168,22 @@ module Loom::Shell
168
168
  cmd_parts.compact!
169
169
  raise "empty command passed to execute" if cmd_parts.empty?
170
170
 
171
- result = if @dry_run
172
- wrap :printf, :first => true do
173
- cmd_result = execute_internal *cmd_parts, **cmd_opts
174
- Loom.log.info do
175
- "\t%s" % prompt_fmt(cmd_result.full_stdout.strip)
176
- end
177
- cmd_result
178
- end
179
- else
180
- execute_internal *cmd_parts, **cmd_opts
181
- end
182
- @session << CmdResult.create_from_sshkit_command(result, is_test, self)
183
-
184
- Loom.log.debug @session.last.stdout unless @session.last.stdout.empty?
185
- Loom.log.debug @session.last.stderr unless @session.last.stderr.empty?
186
- @session.last
171
+ sshkit_result = if @dry_run
172
+ wrap(:printf, first: true) do
173
+ r = execute_internal(*cmd_parts, **cmd_opts)
174
+ Loom.log.info { "\t%s" % prompt_fmt(cmd_result.full_stdout.strip) }
175
+ r
176
+ end
177
+ else
178
+ execute_internal(*cmd_parts, **cmd_opts)
179
+ end
180
+ result =
181
+ CmdResult.create_from_sshkit_command(sshkit_result, is_test, self)
182
+
183
+ @session << result
184
+ Loom.log.debug result.stdout unless result.stdout.empty?
185
+ Loom.log.debug result.stderr unless result.stderr.empty?
186
+ result
187
187
  end
188
188
  alias_method :exec, :execute
189
189
 
@@ -1,3 +1,3 @@
1
1
  module Loom
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -62,6 +62,7 @@ module LoomExt::CoreMods
62
62
 
63
63
  class Fail < Loom::Mods::Module
64
64
  register_mod :fail do |message=nil|
65
+ # TODO: create a stacktrace that indicates the raise happened from the .loom file.
65
66
  raise FailError, message
66
67
  end
67
68
  end
@@ -0,0 +1,797 @@
1
+
2
+ lib/loom/mods.rb,22
3
+ module Loom::Mods1,0
4
+
5
+ lib/loom/shell/cmd_wrapper.rb,657
6
+ module Loom::Shell3,22
7
+ class CmdWrapper5,42
8
+ def escape(11,177
9
+ def wrap_cmd(22,480
10
+ def initialize(41,1100
11
+ attr_reader :cmd_partscmd_parts49,1411
12
+ def escape_cmd53,1536
13
+ alias_method :to_s,to_s59,1702
14
+ def wrap(63,1845
15
+ def escape_inner70,2024
16
+ def escape_parts(91,2774
17
+ class CmdRedirect106,3046
18
+ def append_stdout(109,3085
19
+ module Mode115,3223
20
+ INPUT 116,3239
21
+ OUTPUT 117,3260
22
+ APPEND 118,3283
23
+ OUTPUT_12 119,3306
24
+ APPEND_12 120,3340
25
+ def initialize(123,3383
26
+ def to_s129,3499
27
+ class CmdPipeline148,3893
28
+ def initialize(149,3913
29
+ def to_s153,3984
30
+
31
+ lib/loom/shell/core.rb,876
32
+ module Loom::Shell5,61
33
+ class Core7,81
34
+ def initialize(9,95
35
+ attr_reader :session,session25,544
36
+ attr_reader :session, :shell_api,shell_api25,544
37
+ attr_reader :session, :shell_api, :mod_loader,mod_loader25,544
38
+ attr_reader :session, :shell_api, :mod_loader, :dry_rundry_run25,544
39
+ def is_sudo?27,605
40
+ def local31,657
41
+ def test(35,744
42
+ def verify(56,1590
43
+ def verify_which(60,1672
44
+ def wrap(64,1740
45
+ def sudo(82,2173
46
+ def cd(135,4002
47
+ def capture(149,4369
48
+ def pipe(158,4616
49
+ def upload(163,4732
50
+ def execute(167,4835
51
+ alias_method :exec,exec188,5669
52
+ def prompt_label191,5717
53
+ def prompt_fmt(197,5811
54
+ def execute_internal(202,5950
55
+ def create_command(229,7042
56
+ class LocalShell 256,8216
57
+ def initialize(257,8244
58
+ def local262,8395
59
+ def prompt_label266,8463
60
+
61
+ lib/loom/shell/harness_blob.rb,172
62
+ module Loom::Shell4,40
63
+ class HarnessBlob7,115
64
+ def initialize(9,136
65
+ attr_reader :cmd_blobcmd_blob13,201
66
+ def encoded_script15,228
67
+ def checksum22,487
68
+
69
+ lib/loom/shell/session.rb,186
70
+ module Loom::Shell1,0
71
+ class Session2,19
72
+ def initialize3,35
73
+ attr_reader :command_resultscommand_results8,113
74
+ def success?10,147
75
+ def last14,188
76
+ def <<(18,238
77
+
78
+ lib/loom/shell/cmd_result.rb,582
79
+ module Loom::Shell1,0
80
+ class CmdResult2,19
81
+ def initialize(3,37
82
+ attr_reader :command,command13,292
83
+ attr_reader :command, :stdout,stdout13,292
84
+ attr_reader :command, :stdout, :stderr,stderr13,292
85
+ attr_reader :command, :stdout, :stderr, :exit_status,exit_status13,292
86
+ attr_reader :command, :stdout, :stderr, :exit_status, :time,time13,292
87
+ attr_reader :command, :stdout, :stderr, :exit_status, :time, :is_testis_test13,292
88
+ def success?15,367
89
+ def pipe(19,417
90
+ def self.create_from_sshkit_command(create_from_sshkit_command24,557
91
+
92
+ lib/loom/shell/api.rb,361
93
+ module Loom::Shell1,0
94
+ class Api6,129
95
+ def initialize(8,142
96
+ def dry_run?14,266
97
+ def local18,307
98
+ def method_missing(23,428
99
+ class FakeApi 34,939
100
+ def initialize37,982
101
+ attr_reader :cmd_executions,cmd_executions41,1067
102
+ attr_reader :cmd_executions, :cmd_execution_argscmd_execution_args41,1067
103
+ def method_missing(43,1121
104
+
105
+ lib/loom/shell/harness_command_builder.rb,300
106
+ module Loom1,0
107
+ module Shell2,12
108
+ HarnessMissingStdin 4,28
109
+ class HarnessCommandBuilder6,81
110
+ SCRIPT 9,156
111
+ DEFAULT_RUN_OPTS 11,195
112
+ def initialize(16,311
113
+ def run_cmd21,435
114
+ def check_cmd28,643
115
+ def hash_to_opts_array(35,819
116
+ def build_cmd(41,958
117
+
118
+ lib/loom/shell/harness/session.rb,695
119
+ module Loom6,262
120
+ class HostSession12,443
121
+ HISTORY_FILE 14,464
122
+ def initialize(19,634
123
+ attr_reader :session_namesession_name31,979
124
+ def bootstrap33,1010
125
+ def disabled?40,1209
126
+ def execute_pattern(46,1346
127
+ def handle_host_failure(76,2453
128
+ def script_path107,3476
129
+ def session_path112,3573
130
+ def history_file117,3682
131
+ def ensure_loom_remote_dirs121,3755
132
+ def ensure_harness_uploaded132,4160
133
+ def create_command_history136,4268
134
+ def write_to_command_history(140,4351
135
+ def log_to_command_history(144,4469
136
+ def hostname151,4758
137
+ def collect_facts_for_host155,4810
138
+ def create_shell160,4980
139
+ def create_mod_loader164,5070
140
+
141
+ lib/loom/version.rb,32
142
+ module Loom1,0
143
+ VERSION 2,12
144
+
145
+ lib/loom/config.rb,457
146
+ module Loom4,34
147
+ ConfigError 6,47
148
+ class Config8,90
149
+ CONFIG_VARS 12,243
150
+ attr_reader *CONFIG_VARS.keys, :config_mapconfig_map37,1048
151
+ def initialize(39,1096
152
+ def [](49,1357
153
+ def to_yaml53,1405
154
+ alias_method :dump,dump56,1455
155
+ def files60,1678
156
+ def configure(65,1739
157
+ class FileManager77,2124
158
+ def initialize(79,2147
159
+ def find(85,2337
160
+ def loom_files89,2419
161
+ def search_loom_paths(94,2541
162
+
163
+ lib/loom/inventory.rb,614
164
+ module Loom3,16
165
+ module Inventory4,28
166
+ InvalidHostEntry 6,48
167
+ InventoryFileEntryError 7,97
168
+ INVENTORY_FILE_NAMES 9,154
169
+ class InventoryList14,236
170
+ def total_inventory(17,281
171
+ def active_inventory(26,637
172
+ def inventory_files(42,1290
173
+ attr_reader :hostshosts47,1408
174
+ def initialize(49,1434
175
+ def disable(57,1687
176
+ def disabled?(61,1767
177
+ def hostnames65,1844
178
+ def group_names69,1913
179
+ def parse_hosts(74,1988
180
+ class InventoryFileSet83,2213
181
+ def initialize(84,2240
182
+ def hostgroup_map94,2500
183
+ def hostlist108,2862
184
+
185
+ lib/loom/core_ext.rb,152
186
+ module Loom1,0
187
+ module CoreExt2,12
188
+ def underscore4,50
189
+ def demodulize11,231
190
+ module ModuleExt16,301
191
+ def loom_accessor(21,529
192
+
193
+ lib/loom/logger.rb,415
194
+ module Loom3,18
195
+ class Logger4,30
196
+ COLOR_MAP 5,45
197
+ def configure(14,184
198
+ def configure_device(42,1074
199
+ def default_formatter(61,1561
200
+ module LoggerDebugLevels78,2071
201
+ NUM_DEBUG_LEVELS 79,2100
202
+ def format_severity(96,2655
203
+ def debug_at_level(105,2849
204
+ class Styleizer113,3119
205
+ STYLE_CODES 116,3160
206
+ def apply(128,3419
207
+ def styleize(134,3591
208
+
209
+ lib/loom/trap.rb,376
210
+ module Loom1,0
211
+ class Trap2,12
212
+ class SignalExit 4,26
213
+ attr_reader :signalsignal5,65
214
+ def initialize(7,92
215
+ module Sig13,208
216
+ HUP 14,223
217
+ INT 15,241
218
+ QUIT 16,259
219
+ TERM 17,279
220
+ USR1 18,299
221
+ USR2 19,319
222
+ def self.install(install22,348
223
+ class Handler29,543
224
+ def initialize(31,562
225
+ def handle(36,666
226
+
227
+ lib/loom/dsl.rb,159
228
+ module Loom8,298
229
+ module DSL11,408
230
+ UnexpectedHostError 12,421
231
+ SSHConnectionError 13,473
232
+ def on_host(21,776
233
+ class SSHKitDSLShadow63,2173
234
+
235
+ lib/loom/runner.rb,318
236
+ module Loom1,0
237
+ class Runner2,12
238
+ PatternExecutionError 4,28
239
+ FailFastExecutionError 5,82
240
+ def initialize(9,167
241
+ def run(30,680
242
+ def install_signal_traps91,2814
243
+ def load111,3454
244
+ def run_internal(128,4042
245
+ def execute_pattern(187,6496
246
+ def handle_host_failure_strategy(222,7911
247
+
248
+ lib/loom/facts/fact_set.rb,581
249
+ module Loom::Facts1,0
250
+ def is_empty?(4,36
251
+ EMPTY 9,107
252
+ def [](11,137
253
+ class FactSet20,406
254
+ InvalidFactName 22,423
255
+ InvalidFactValue 23,471
256
+ UnmarshalableError 24,520
257
+ def create_for_host(27,590
258
+ def initialize(68,1997
259
+ attr_reader :host_spechost_spec79,2288
260
+ def merge(81,2316
261
+ def hostname94,2668
262
+ def sshname105,2983
263
+ def get(109,3033
264
+ alias_method :[],[]118,3207
265
+ def facts120,3235
266
+ def to_s124,3278
267
+ def validate_facts(129,3374
268
+ def validate_fact_name(137,3602
269
+ def validate_fact_value(141,3719
270
+
271
+ lib/loom/facts/fact_file_provider.rb,472
272
+ module Loom::Facts3,16
273
+ class FactFileProvider 5,36
274
+ InvalidFactFileConversion 7,73
275
+ YAML_FILE_GLOBS 9,132
276
+ TXT_FILE_GLOBS 15,230
277
+ ALL_FILE_GLOBS 20,302
278
+ def initialize(35,690
279
+ def collect_facts39,768
280
+ def convert_path_to_map44,833
281
+ def convert_file_paths(49,912
282
+ def load_config(58,1218
283
+ class YAMLFactFileProvider 63,1310
284
+ def convert_path_to_map(65,1359
285
+ class TxtFileProvider 71,1435
286
+ def convert_path_to_map(73,1479
287
+
288
+ lib/loom/facts/provider.rb,344
289
+ module Loom::Facts1,0
290
+ class Provider3,20
291
+ attr_reader :fact_map,fact_map5,103
292
+ attr_reader :fact_map, :namespacenamespace5,103
293
+ def disable_for_host(12,405
294
+ def disabled_for_host?(19,693
295
+ def register_factory(25,904
296
+ def create_fact_providers(31,1102
297
+ def disable(38,1299
298
+ def collect_facts43,1451
299
+
300
+ lib/loom/mods/action_proxy.rb,562
301
+ module Loom::Mods3,122
302
+ class ActionProxy4,140
303
+ def initialize(6,161
304
+ def proxy_for_namespace(12,285
305
+ def new_action_map19,411
306
+ def subclass_for_action_map(23,469
307
+ def install_action_map(29,634
308
+ def install_root_actions(34,778
309
+ def install_namespace_action_proxies(61,1874
310
+ class ActionMap80,2529
311
+ attr_reader :action_tuples,action_tuples82,2550
312
+ attr_reader :action_tuples, :ns_actionmapsns_actionmaps82,2550
313
+ def initialize84,2600
314
+ def add_action(89,2688
315
+ def add_namespace(100,3065
316
+
317
+ lib/loom/mods/module.rb,994
318
+ module Loom::Mods1,0
319
+ ModActionError 3,19
320
+ InvalidModActionSignature 4,64
321
+ class Module6,121
322
+ attr_accessor :shell,shell7,136
323
+ attr_accessor :shell,shell=7,136
324
+ attr_accessor :shell, :loom_config,loom_config7,136
325
+ attr_accessor :shell, :loom_config,loom_config=7,136
326
+ attr_accessor :shell, :loom_config, :loom,loom7,136
327
+ attr_accessor :shell, :loom_config, :loom,loom=7,136
328
+ attr_accessor :shell, :loom_config, :loom, :mods,mods7,136
329
+ attr_accessor :shell, :loom_config, :loom, :mods,mods=7,136
330
+ attr_accessor :shell, :loom_config, :loom, :mods, :action_proxyaction_proxy7,136
331
+ attr_accessor :shell, :loom_config, :loom, :mods, :action_proxyaction_proxy=7,136
332
+ def initialize(9,205
333
+ def init_action(30,1030
334
+ def execute(35,1144
335
+ def register_mod(57,1993
336
+ def required_commands(79,3131
337
+ def import_actions(85,3295
338
+ def bind_action(94,3632
339
+ def action_proxy(115,4576
340
+ def action_map123,4849
341
+
342
+ lib/loom/mods/mod_loader.rb,356
343
+ module Loom::Mods1,0
344
+ AliasRegisteredError 3,19
345
+ AnonymousModLoadError 4,70
346
+ ModDefinedError 5,122
347
+ ModNotRegisteredError 6,169
348
+ class ModLoader8,222
349
+ def initialize(9,240
350
+ def verify_shell_cmds(13,314
351
+ def register_mod(27,729
352
+ def define_mod_factory(48,1496
353
+ def registered_mods63,2016
354
+ def alias_module(68,2099
355
+
356
+ lib/loom/pattern/reference.rb,378
357
+ module Loom::Pattern1,0
358
+ class Reference2,21
359
+ attr_reader :slug,slug4,40
360
+ attr_reader :slug, :source_file,source_file4,40
361
+ attr_reader :slug, :source_file, :descdesc4,40
362
+ def initialize(6,84
363
+ def is_expanding?14,332
364
+ def call(18,375
365
+ class RunContext44,1281
366
+ def initialize(45,1302
367
+ def run(50,1456
368
+ def apply_pattern(73,2275
369
+
370
+ lib/loom/pattern/dsl.rb,950
371
+ module Outer72,4087
372
+ module Inner77,4168
373
+ module ordering,115,5248
374
+ def top_level;126,5543
375
+ module Submod128,5563
376
+ module Loom::Pattern249,9604
377
+ PatternDefinitionError 251,9626
378
+ module DSL259,9856
379
+ def pattern_mod_init261,9870
380
+ def description(275,10094
381
+ alias_method :desc,desc278,10173
382
+ def with_facts(280,10211
383
+ def let(286,10404
384
+ def pattern(291,10589
385
+ def report(297,10750
386
+ def weave(327,12076
387
+ def before(334,12301
388
+ def after(338,12360
389
+ def weave_slugs342,12417
390
+ def is_weave?(351,12635
391
+ def pattern_methods355,12716
392
+ def pattern_description(359,12787
393
+ def pattern_method(363,12867
394
+ def hooks368,13004
395
+ def facts372,13040
396
+ def let_map376,13079
397
+ def define_pattern_internal(385,13436
398
+ def hook(421,14715
399
+ class LetMapEntry426,14804
400
+ attr_reader :default,default427,14824
401
+ attr_reader :default, :blockblock427,14824
402
+ def initialize(428,14857
403
+
404
+ lib/loom/pattern/reference_set.rb,881
405
+ module Loom::Pattern9,440
406
+ DuplicatePatternRef 11,462
407
+ UnknownPatternMethod 12,512
408
+ InvalidPatternNamespace 13,563
409
+ class ReferenceSet17,670
410
+ def load_from_file(20,710
411
+ def initialize26,879
412
+ def slugs30,935
413
+ def pattern_refs34,986
414
+ def get_pattern_ref(38,1046
415
+ alias_method :[],[]43,1179
416
+ def merge!(45,1219
417
+ def add_pattern_refs(49,1302
418
+ class Builder58,1584
419
+ def create(62,1691
420
+ def initialize(74,2123
421
+ def build80,2301
422
+ def pattern_refs87,2439
423
+ def refs_for_mod_spec(91,2554
424
+ def build_expanding_reference(108,3135
425
+ def build_pattern_reference(115,3413
426
+ def context_for_mod_spec(123,3732
427
+ def compute_slug(135,4113
428
+ def mod_namespace_list(139,4246
429
+ def pattern_mod_specs155,4838
430
+ def is_pattern_module(172,5446
431
+ def traverse_pattern_modules(177,5587
432
+
433
+ lib/loom/pattern/result_reporter.rb,302
434
+ module Loom::Pattern1,0
435
+ class ResultReporter2,21
436
+ def initialize(3,44
437
+ attr_reader :hostnamehostname12,301
438
+ def failure_summary14,328
439
+ def write_report19,432
440
+ def success?31,650
441
+ def scenario_string35,706
442
+ def generate_report40,842
443
+ def generate_cmd_report(63,1747
444
+
445
+ lib/loom/pattern/loader.rb,354
446
+ module Loom::Pattern1,0
447
+ SiteFileNotFound 3,22
448
+ RecursiveExpansionError 4,69
449
+ class Loader6,124
450
+ def load(8,157
451
+ def initialize(15,295
452
+ def slugs20,420
453
+ def patterns(24,470
454
+ def get_pattern_ref(33,668
455
+ alias_method :[],[]36,733
456
+ def load_patterns38,773
457
+ def load_pattern_file(46,948
458
+ def expand_refs(50,1045
459
+
460
+ lib/loom/pattern/expanding_reference.rb,350
461
+ module Loom::Pattern1,0
462
+ class ExpandingReference2,21
463
+ attr_reader :slug,slug4,49
464
+ attr_reader :slug, :reference_slugs,reference_slugs4,49
465
+ attr_reader :slug, :reference_slugs, :source_file,source_file4,49
466
+ attr_reader :slug, :reference_slugs, :source_file, :descdesc4,49
467
+ def initialize(6,111
468
+ def is_expanding?12,274
469
+
470
+ lib/loom/pattern/definition_context.rb,505
471
+ module Loom::Pattern1,0
472
+ class DefinitionContext7,210
473
+ NilLetValueError 9,237
474
+ def initialize(11,287
475
+ attr_reader :let_map,let_map22,599
476
+ attr_reader :let_map, :fact_map,fact_map22,599
477
+ attr_reader :let_map, :fact_map, :hookshooks22,599
478
+ def fact_set(27,734
479
+ def define_let_readers(40,1377
480
+ def before_hooks55,2016
481
+ def after_hooks59,2083
482
+ def merged_fact_map66,2268
483
+ def merged_let_map72,2421
484
+ def merged_hooks82,2762
485
+ def merged_contexts87,2878
486
+
487
+ lib/loom/pattern/pattern.rb,260
488
+ module Loom::Pattern1,0
489
+ class Pattern3,89
490
+ KINDS 5,106
491
+ KIND_KWARGS 10,298
492
+ attr_reader :name,name14,362
493
+ attr_reader :name, :description,description14,362
494
+ attr_reader :name, :description, :kindkind14,362
495
+ def initialize(16,406
496
+
497
+ lib/loom/pattern/hook.rb,240
498
+ module Loom::Pattern1,0
499
+ class Hook2,21
500
+ def around_hooks(5,53
501
+ def before_hooks(9,144
502
+ def after_hooks(13,235
503
+ def initialize(18,332
504
+ attr_reader :scope,scope26,530
505
+ attr_reader :scope, :blockblock26,530
506
+
507
+ lib/loom/method_signature.rb,1299
508
+ module Loom1,0
509
+ class MethodSignature4,60
510
+ module ParamType6,85
511
+ REQ 7,106
512
+ OPT 8,123
513
+ REST 9,140
514
+ KEYREQ 10,159
515
+ KEY 11,182
516
+ KEYREST 12,199
517
+ BLOCK 13,224
518
+ def initialize(17,317
519
+ attr_reader :req_args,req_args28,753
520
+ attr_reader :req_args, :opt_args,opt_args28,753
521
+ attr_reader :req_args, :opt_args, :rest_args,rest_args28,753
522
+ attr_reader :req_args, :opt_args, :rest_args, :keyreq_args,keyreq_args28,753
523
+ attr_reader :req_args, :opt_args, :rest_args, :keyreq_args, :key_args,key_args28,753
524
+ :keyrest_args,keyrest_args29,828
525
+ :keyrest_args, :block_argsblock_args29,828
526
+ def find_by_type(31,872
527
+ def method_missing(36,1029
528
+ class MatchSpec46,1285
529
+ class Builder48,1306
530
+ def initialize49,1326
531
+ def method_missing(61,1617
532
+ def build66,1728
533
+ def builder72,1825
534
+ def initialize(90,2706
535
+ def match?(108,3208
536
+ def check_ordered_args(120,3516
537
+ def check_rest(132,3867
538
+ def check_req_args(136,3986
539
+ def check_opt_args(140,4098
540
+ def check_keyword_args(144,4210
541
+ def check_keyrest(152,4439
542
+ def check_keyreq_args(156,4570
543
+ def check_key_args(162,4746
544
+ def check_block_args(168,4910
545
+
546
+ lib/loom/pattern.rb,48
547
+ module Loom::Pattern1,0
548
+ def included(6,80
549
+
550
+ lib/loom/shell.rb,91
551
+ module Loom1,0
552
+ module Shell2,12
553
+ VerifyError 4,28
554
+ def self.create(create6,73
555
+
556
+ lib/loom/host_spec.rb,316
557
+ module Loom4,40
558
+ UnparseableHostStringError 6,53
559
+ class HostSpec8,111
560
+ attr_accessor :disableddisabled11,152
561
+ attr_accessor :disableddisabled=11,152
562
+ attr_reader :sshkit_hostsshkit_host12,180
563
+ def initialize(16,320
564
+ def is_remote?21,458
565
+ def is_localhost?25,507
566
+ def parse(30,606
567
+
568
+ lib/loom/facts.rb,62
569
+ module Loom3,30
570
+ module Facts4,42
571
+ def fact_set(7,76
572
+
573
+ lib/loom.rb,211
574
+ module Loom3,27
575
+ LoomError 5,40
576
+ ExecutionError 6,80
577
+ def configure(9,136
578
+ def config14,247
579
+ def reset_config22,380
580
+ def log26,430
581
+ def config_changed31,495
582
+ def config_logger37,680
583
+
584
+ lib/loomext/all.rb,13
585
+ LoomExt 1,0
586
+
587
+ lib/loomext/corefacts.rb,43
588
+ module LoomExt1,0
589
+ module CoreFacts2,15
590
+
591
+ lib/loomext/corefacts/all.rb,43
592
+ module LoomExt1,0
593
+ module CoreFacts2,15
594
+
595
+ lib/loomext/corefacts/facter_provider.rb,114
596
+ module LoomExt::CoreFacts1,0
597
+ class FacterProvider 2,26
598
+ def initialize(8,209
599
+ def collect_facts15,395
600
+
601
+ lib/loomext/corefacts/system_info_provider.rb,315
602
+ module LoomExt::CoreFacts1,0
603
+ class SystemInfoProvider 2,26
604
+ def initialize(10,285
605
+ def collect_facts15,384
606
+ def facts_from_vmstat31,901
607
+ def facts_from_proc_loadavg42,1357
608
+ def facts_from_df59,1951
609
+ def facts_from_etc_os_release80,2587
610
+ def facts_from_sys_class_thermal_zones94,2953
611
+
612
+ lib/loomext/coremods/files.rb,434
613
+ module LoomExt::CoreMods1,0
614
+ class Files 2,25
615
+ def init_action(9,269
616
+ def each_path(18,519
617
+ module Actions37,1043
618
+ def cat39,1063
619
+ def rm45,1157
620
+ def mv(51,1255
621
+ def match?(57,1367
622
+ def gsub(66,1554
623
+ def chown(76,1832
624
+ def touch84,2044
625
+ def mkdir(88,2107
626
+ def ensure_line(94,2358
627
+ def sudo_append(118,3077
628
+ def append(130,3411
629
+ def write(159,4505
630
+
631
+ lib/loomext/coremods/systemd/systemd.rb,366
632
+ module LoomExt::CoreMods1,0
633
+ module SystemdCommon3,26
634
+ def do_systemctl(4,49
635
+ class Systemd 20,385
636
+ module Actions25,476
637
+ def is_loaded?(27,496
638
+ def is_active?(31,586
639
+ def status(35,663
640
+ def enable(39,733
641
+ def start(43,803
642
+ def disable(47,871
643
+ def restart(51,943
644
+ def stop(55,1015
645
+ def link(59,1081
646
+
647
+ lib/loomext/coremods/systemd/systemd_units.rb,415
648
+ module LoomExt::CoreMods1,0
649
+ module SystemdUnitsCommon3,26
650
+ def init_action(5,55
651
+ def do_systemctl_list(10,143
652
+ def common_list_flags14,270
653
+ class SystemdUnits 19,348
654
+ module Actions25,481
655
+ def list26,500
656
+ def status30,559
657
+ class SystemdSockets 40,740
658
+ module Actions46,871
659
+ def list47,890
660
+ class SystemdTimers 55,993
661
+ module Actions61,1122
662
+ def list62,1141
663
+
664
+ lib/loomext/coremods/exec.rb,289
665
+ module LoomExt::CoreMods2,41
666
+ FailError 4,67
667
+ class Exec 10,203
668
+ class ExecEcho 18,435
669
+ class ChangeDirectory 24,592
670
+ class Timeout 32,862
671
+ class Time 38,1033
672
+ class Sudo 44,1173
673
+ class SudoCheck 51,1380
674
+ class Test 57,1485
675
+ class Fail 63,1589
676
+ class Upload 69,1709
677
+
678
+ lib/loomext/coremods/all.rb,42
679
+ module LoomExt1,0
680
+ module CoreMods2,15
681
+
682
+ lib/loomext/coremods/package/adapter.rb,804
683
+ module LoomExt::CoreMods1,0
684
+ class Package 2,25
685
+ class PkgAdapter4,63
686
+ attr_reader :loomloom6,85
687
+ def initialize(8,110
688
+ def ensure_installed(12,169
689
+ def installed?(16,271
690
+ def install(20,344
691
+ def uninstall(24,415
692
+ def update_cache28,488
693
+ def upgrade(32,554
694
+ class GemAdapter 37,633
695
+ def installed?(38,667
696
+ def install(42,756
697
+ class DpkgAdapter 47,843
698
+ def installed?(49,879
699
+ class AptAdapter 54,969
700
+ def install(56,1005
701
+ def uninstall(61,1170
702
+ def update_cache65,1248
703
+ def upgrade(70,1371
704
+ class RpmAdapter 77,1561
705
+ def installed?(79,1596
706
+ class DnfAdapter 85,1688
707
+ def install(87,1723
708
+ def uninstall(91,1826
709
+ def update_cache96,1975
710
+ def upgrade(100,2064
711
+
712
+ lib/loomext/coremods/package/package.rb,295
713
+ module LoomExt::CoreMods4,50
714
+ class Package 5,75
715
+ UnsupportedPackageManager 7,113
716
+ attr_reader :pkg_adapterpkg_adapter9,183
717
+ def init_action13,236
718
+ def get(17,302
719
+ alias_method :[],[]33,649
720
+ def default_adapter35,677
721
+ module Actions49,1026
722
+ def [](54,1191
723
+
724
+ lib/loomext/coremods/vm/all.rb,46
725
+ module LoomExt::CoreMods1,0
726
+ module VM2,25
727
+
728
+ lib/loomext/coremods/vm/vbox.rb,341
729
+ module LoomExt::CoreMods::VM1,0
730
+ class Virtualbox 2,29
731
+ DuplicateVMImport 4,70
732
+ UnknownVM 5,125
733
+ module Actions10,231
734
+ def check_exists(11,250
735
+ def check_running(15,342
736
+ def list21,492
737
+ def snapshot(25,562
738
+ def import(35,839
739
+ def clone(47,1213
740
+ def up(65,1836
741
+ def down(73,2055
742
+
743
+ lib/loomext/coremods/net.rb,205
744
+ module LoomExt::CoreMods1,0
745
+ class Net 2,25
746
+ NoNetworkError 4,59
747
+ def init_action(8,135
748
+ module Actions13,260
749
+ def has_net?15,280
750
+ def check_net21,451
751
+ def with_net(25,551
752
+
753
+ lib/loomext/coremods/user.rb,423
754
+ module LoomExt::CoreMods1,0
755
+ class User 2,25
756
+ SudoersDNoExistError 4,60
757
+ SudoersDNotIncluded 5,124
758
+ SUDOERS_FILE 10,262
759
+ SUDOERS_DIR 11,296
760
+ LOOM_SUDOERS_FILE 12,331
761
+ def user_exists?(14,389
762
+ def includes_sudoers?18,465
763
+ def sudoersd_exists?22,579
764
+ module Actions26,659
765
+ def add(27,678
766
+ def add_system_user(51,1416
767
+ def remove(60,1690
768
+ def make_sudoer(69,1902
769
+
770
+ lib/loomext/coremods/git.rb,115
771
+ module LoomExt::CoreMods1,0
772
+ class Git 2,25
773
+ module Actions7,109
774
+ def push8,128
775
+ def pull12,188
776
+
777
+ lib/loomext/coremods.rb,42
778
+ module LoomExt1,0
779
+ module CoreMods2,15
780
+
781
+ lib/loomext/coremods/vm.rb,0
782
+
783
+ lib/loomext/coremods/systemd.rb,0
784
+
785
+ lib/loomext/coremods/systemd/all.rb,0
786
+
787
+ lib/env/development.rb,0
788
+
789
+ lib/loom/pattern/all.rb,0
790
+
791
+ lib/loom/mods/all.rb,0
792
+
793
+ lib/loom/facts/all.rb,0
794
+
795
+ lib/loom/all.rb,0
796
+
797
+ lib/loom/shell/all.rb,0