beaker 2.10.0 → 2.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +8 -8
  2. data/HISTORY.md +292 -4
  3. data/acceptance/tests/base/host.rb +1 -0
  4. data/lib/beaker/answers/version30.rb +10 -10
  5. data/lib/beaker/cli.rb +10 -8
  6. data/lib/beaker/command.rb +1 -1
  7. data/lib/beaker/dsl/helpers/facter_helpers.rb +10 -1
  8. data/lib/beaker/dsl/helpers/hiera_helpers.rb +0 -11
  9. data/lib/beaker/dsl/helpers/host_helpers.rb +12 -3
  10. data/lib/beaker/dsl/helpers/puppet_helpers.rb +11 -3
  11. data/lib/beaker/dsl/helpers/tk_helpers.rb +0 -12
  12. data/lib/beaker/dsl/helpers/web_helpers.rb +0 -12
  13. data/lib/beaker/dsl/install_utils/module_utils.rb +9 -6
  14. data/lib/beaker/dsl/install_utils/pe_utils.rb +60 -8
  15. data/lib/beaker/dsl/install_utils/puppet_utils.rb +15 -2
  16. data/lib/beaker/host.rb +11 -145
  17. data/lib/beaker/host/mac.rb +3 -7
  18. data/lib/beaker/host/mac/pkg.rb +43 -0
  19. data/lib/beaker/host/pswindows.rb +1 -1
  20. data/lib/beaker/host/pswindows/exec.rb +83 -2
  21. data/lib/beaker/host/pswindows/pkg.rb +9 -6
  22. data/lib/beaker/host/unix/exec.rb +105 -0
  23. data/lib/beaker/host/unix/pkg.rb +22 -9
  24. data/lib/beaker/host/windows.rb +2 -1
  25. data/lib/beaker/host/windows/exec.rb +1 -1
  26. data/lib/beaker/host/windows/pkg.rb +4 -7
  27. data/lib/beaker/host_prebuilt_steps.rb +14 -14
  28. data/lib/beaker/hypervisor/aws_sdk.rb +198 -114
  29. data/lib/beaker/hypervisor/openstack.rb +48 -25
  30. data/lib/beaker/shared/host_manager.rb +11 -2
  31. data/lib/beaker/ssh_connection.rb +26 -0
  32. data/lib/beaker/version.rb +1 -1
  33. data/spec/beaker/answers_spec.rb +56 -0
  34. data/spec/beaker/cli_spec.rb +16 -12
  35. data/spec/beaker/command_spec.rb +3 -0
  36. data/spec/beaker/dsl/install_utils/module_utils_spec.rb +2 -2
  37. data/spec/beaker/dsl/install_utils/pe_utils_spec.rb +71 -3
  38. data/spec/beaker/dsl/install_utils/puppet_utils_spec.rb +4 -1
  39. data/spec/beaker/host/unix/pkg_spec.rb +10 -10
  40. data/spec/beaker/host_prebuilt_steps_spec.rb +3 -1
  41. data/spec/beaker/host_spec.rb +8 -2
  42. data/spec/beaker/hypervisor/vagrant_spec.rb +1 -0
  43. metadata +3 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmY2Mjc5OTAyMTE2ODI4ZWNkMGYwMTkyMjE2NDVjNTRmM2FiYzA5Nw==
4
+ YjcxZmM2NGE2YTM1ZjAwZmU4MDI4M2U0NzZmOTk4MzMxZDg3NDRiOQ==
5
5
  data.tar.gz: !binary |-
6
- MzMyODZhZDIwMzJkNzYwZjdlYmVjNTNlODdjODg5NmJjNjdkNGJiNQ==
6
+ Y2M3MmViODg0MTdiZDIxZWZjNjIyYmExMWMwMGFkMzA4OTViZmQxOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjRmYmIzOGJmMzE2YWNiYjVmMWUzMGQyYjgwNTg3NzU0NDdmNGQ4ZDhiNThl
10
- MmE2NmU3MWU3OWRhMGYwZjQ0ZDQ2ZTc2M2U1NGVjNDJhNDZhYTI4MzkzOWEz
11
- N2JiNmVhNjRiYmJmM2U2NzM1Mjg0NDA5ZTg2MGFjYTA4NGM5ZmI=
9
+ N2VjY2E2NmM2N2E3MGUyOTBkY2FlZTM3MjUwZjY5YjE0OGU4N2JjYTI1OWNi
10
+ MWM1YzIyYzgzOWM2ZWJhNjdjNmIxMzAyMmZkMzk3Njk3Mzc4ZWQwM2ZjYWZj
11
+ MzhiZTVmYTQ0NzE0YTU2MTVhZjg4NDBjYjlhNTk0YTQ4ZGNjMDk=
12
12
  data.tar.gz: !binary |-
13
- YTk0ZThhMGRkYzEwMWRjNjdkNTBkZmE3NzI0Y2E3YjcyOWI5NmYwOTExYjg4
14
- MDA1MzY5YzE4NDVjMWE5N2MzYTczZjdhMjRlOWQwZGUzMGUxZmJhNWM4N2E2
15
- YTU2YjFmN2JiNmZlMjgyNmRiYzMyYWE3ZDZiNzJlMjY0MTQ1NDg=
13
+ ZmRjZDhkNjU5ODQyMjY3YjZlNTc2NTIyYmYwMzNlOTA1YmJhZmFhZmQ2Y2Y3
14
+ ODEyODVkMzZhMjcxMTQ0NTYzYjNmYmVlZThjZWMzNmQwNWJkMTAyY2RlYzVk
15
+ MTNkYmQ3NjE5OTNkMTJkODk5ZGE0ZWFmNjVlODI4YjYyMTUyNzk=
data/HISTORY.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # default - History
2
2
  ## Tags
3
- * [LATEST - 22 Apr, 2015 (2f834676)](#LATEST)
3
+ * [LATEST - 6 May, 2015 (50128ac0)](#LATEST)
4
+ * [2.10.0 - 22 Apr, 2015 (c4f37479)](#2.10.0)
4
5
  * [2.9.0 - 9 Apr, 2015 (b161d325)](#2.9.0)
5
6
  * [beaker2.8.0 - 26 Mar, 2015 (2d25d06d)](#beaker2.8.0)
6
7
  * [beaker2.7.1 - 19 Mar, 2015 (45b2bf10)](#beaker2.7.1)
@@ -78,7 +79,294 @@
78
79
  * [pe1.2 - 6 Sep, 2011 (ba3dadd2)](#pe1.2)
79
80
 
80
81
  ## Details
81
- ### <a name = "LATEST">LATEST - 22 Apr, 2015 (2f834676)
82
+ ### <a name = "LATEST">LATEST - 6 May, 2015 (50128ac0)
83
+
84
+ * (GEM) update beaker version to 2.11.0 (50128ac0)
85
+
86
+ * Merge pull request #806 from kevpl/bkr240_windows_rebootfix (7455593a)
87
+
88
+
89
+ ```
90
+ Merge pull request #806 from kevpl/bkr240_windows_rebootfix
91
+
92
+ (BKR-240) added a reason code on reboot for windows
93
+ ```
94
+ * Merge pull request #803 from puppetlabs/fix/qeng-2009_3.99_windows_msi_name (4098e30c)
95
+
96
+
97
+ ```
98
+ Merge pull request #803 from puppetlabs/fix/qeng-2009_3.99_windows_msi_name
99
+
100
+ (QENG-2009) Fix windows MSI name for 3.99
101
+ ```
102
+ * Merge pull request #804 from davemcdonnell/fix_pty_typo_el7 (0de90408)
103
+
104
+
105
+ ```
106
+ Merge pull request #804 from davemcdonnell/fix_pty_typo_el7
107
+
108
+ Fix typo ptry => pty, sudo failing on el7
109
+ ```
110
+ * Merge pull request #802 from anodelman/win-fix (d17a309e)
111
+
112
+
113
+ ```
114
+ Merge pull request #802 from anodelman/win-fix
115
+
116
+ (BKR-191) replace is_cygwin? with a more understandable name
117
+ ```
118
+ * Merge pull request #808 from kevpl/bkr235_answers_puppetdbcustomize (441bf997)
119
+
120
+
121
+ ```
122
+ Merge pull request #808 from kevpl/bkr235_answers_puppetdbcustomize
123
+
124
+ (BKR-235) Added Customization for External Postgres
125
+ ```
126
+ * Merge pull request #807 from kevpl/bkr241_windows_install32bitpuppetagent (cacb37e0)
127
+
128
+
129
+ ```
130
+ Merge pull request #807 from kevpl/bkr241_windows_install32bitpuppetagent
131
+
132
+ Bkr241 windows install32bitpuppetagent
133
+ ```
134
+ * Merge pull request #809 from kevpl/bkr243_preservedhosts_v2 (5d74773c)
135
+
136
+
137
+ ```
138
+ Merge pull request #809 from kevpl/bkr243_preservedhosts_v2
139
+
140
+ (BKR-243) improved preserved-hosts file saving
141
+ ```
142
+ * (BKR-243) improved preserved-hosts file saving (282bb9e4)
143
+
144
+ * (BKR-240) added a reason code on reboot for windows (24fc8038)
145
+
146
+ * Merge pull request #791 from rbrw/ticket/master/bkr-217-rotate-ec2-subnets (61b3b1bd)
147
+
148
+
149
+ ```
150
+ Merge pull request #791 from rbrw/ticket/master/bkr-217-rotate-ec2-subnets
151
+
152
+ (BKR-217) aws_sdk: given CONFIG subnet_ids, try each in turn
153
+ ```
154
+ * Merge pull request #793 from kevpl/bkr180_install_middleman (90eb818e)
155
+
156
+
157
+ ```
158
+ Merge pull request #793 from kevpl/bkr180_install_middleman
159
+
160
+ (BKR-180) added ability to use Beaker machine as scp middle-man for PE
161
+ ```
162
+ * Merge pull request #797 from anodelman/sweep (f40ed598)
163
+
164
+
165
+ ```
166
+ Merge pull request #797 from anodelman/sweep
167
+
168
+ (BKR-224) on(node, 'puppet agent -t') raises no warning when node = []
169
+ ```
170
+ * Merge pull request #798 from fiddyspence/bug/move_round_openstack_address_assignments (30019ce0)
171
+
172
+
173
+ ```
174
+ Merge pull request #798 from fiddyspence/bug/move_round_openstack_address_assignments
175
+
176
+ (BKR-223) Change order of how we assign IPs to openstack instances
177
+ ```
178
+ * Merge pull request #801 from anodelman/maint (40b18ed0)
179
+
180
+
181
+ ```
182
+ Merge pull request #801 from anodelman/maint
183
+
184
+ (BKR-215) Document all of the options to #on and friends
185
+ ```
186
+ * BKR-245 Fix typo ptry => pty, restart sshd failing on el7 when running sudo (07f69955)
187
+
188
+ * (QENG-2009) Update beaker specs for 3.99 windows msi fix (8b5401f7)
189
+
190
+ * (QENG-2009) Fix windows MSI name for 3.99 (cd07eb83)
191
+
192
+
193
+ ```
194
+ (QENG-2009) Fix windows MSI name for 3.99
195
+
196
+ We were only using puppet-agent for 4.0, this
197
+ commit bumps that down to 3.99.
198
+ ```
199
+ * (BKR-235) all necessary answers to use an external postgres host are now customizable (493fea00)
200
+
201
+ * (BKR-191) replace is_cygwin? with a more understandable name (2c67d735)
202
+
203
+
204
+ ```
205
+ (BKR-191) replace is_cygwin? with a more understandable name
206
+
207
+ - create is_powershell?, update usages of is_cygwin as appropriate
208
+ - move powershell only code into pswindows host object
209
+ - fixes related to breakages discovered when this code was moved
210
+ ```
211
+ * (BKR-215) Document all of the options to #on and friends (1dda76e3)
212
+
213
+
214
+ ```
215
+ (BKR-215) Document all of the options to #on and friends
216
+
217
+ - updates shared options to be current (with info for
218
+ accept_all_exit_codes and friends)
219
+ - yard doc does a single pass and you can't guarantee file ordering, so
220
+ you have to have the common options macro in each file that needs it -
221
+ duplication yay!
222
+ ```
223
+ * (MAINT) update acceptable_exit_codes usage to accept_all_exit_codes (402b4d85)
224
+
225
+
226
+ ```
227
+ (MAINT) update acceptable_exit_codes usage to accept_all_exit_codes
228
+
229
+ - we are abusing acceptable_exit_codes all over the place by giving it a
230
+ mega-array, basically recreating the functionality of
231
+ accept_all_exit_codes
232
+ ```
233
+ * (BKR-235) added ability to customize puppetdb_hostname answer (3d5d5b64)
234
+
235
+ * (BKR-223) Change order of how we assign IPs to openstack instances (f6d2c521)
236
+
237
+ * (BKR-224) on(node, 'puppet agent -t') raises no warning when node = [] (69315874)
238
+
239
+
240
+ ```
241
+ (BKR-224) on(node, 'puppet agent -t') raises no warning when node = []
242
+
243
+ - if a logger is defined then send a warning message if attempting to
244
+ run a command against an array of 0 nodes
245
+ ```
246
+ * Merge pull request #794 from kevpl/bkr199_cumulus_packageupdate (4e556c5b)
247
+
248
+
249
+ ```
250
+ Merge pull request #794 from kevpl/bkr199_cumulus_packageupdate
251
+
252
+ (BKR-199) updated cumulus packages required to reflect current package structure
253
+ ```
254
+ * Merge pull request #795 from fiddyspence/bug/rsync_source_always_nil (7bc2c62e)
255
+
256
+
257
+ ```
258
+ Merge pull request #795 from fiddyspence/bug/rsync_source_always_nil
259
+
260
+ (BKR-225) rsync module_utils method source is always nil
261
+ ```
262
+ * Merge pull request #788 from fiddyspence/feature/do_you_want_openstack_region_support_this_time (c35ec983)
263
+
264
+
265
+ ```
266
+ Merge pull request #788 from fiddyspence/feature/do_you_want_openstack_region_support_this_time
267
+
268
+ [openstack] enable support for multiple regions
269
+ ```
270
+ * (BKR-225) rsync module_utils method source is always nil (e3db6871)
271
+
272
+
273
+ ```
274
+ (BKR-225) rsync module_utils method source is always nil
275
+
276
+ sadfs
277
+ ```
278
+ * (BKR-199) updated cumulus packages required to reflect current package structure (790c5d44)
279
+
280
+ * (BKR-180) added ability to use Beaker machine as scp middle-man for PE (b97640c0)
281
+
282
+ * (BKR-217) aws_sdk: given CONFIG subnet_ids, try each in turn (08e4f79d)
283
+
284
+
285
+ ```
286
+ (BKR-217) aws_sdk: given CONFIG subnet_ids, try each in turn
287
+
288
+ This should help alleviate the EC2 InsufficientInstanceCapacity.
289
+
290
+ The new policy will only be applied to a host if there isn't a CONFIG
291
+ subnet_id and there isn't a host-specific subnet_id. When it does
292
+ apply, try each subnet in subnet_ids once for each relevant host.
293
+
294
+ The new option can be used like this:
295
+
296
+ CONFIG
297
+ vpc_id: foo
298
+ subnet_ids:
299
+ - x
300
+ - y
301
+ - z
302
+ ```
303
+ * (BKR-27)[openstack] enable support for multiple regions (e32e0b54)
304
+
305
+ * (BKR-217) aws_sdk: Kill EC2 instances on exception (6b0cf490)
306
+
307
+
308
+ ```
309
+ (BKR-217) aws_sdk: Kill EC2 instances on exception
310
+
311
+ Move EC2 cleanup code to kill_instances() and call that from cleanup(),
312
+ and from a new exception handler in launch_all_nodes(), to be sure we
313
+ don't leave instances running when something goes wrong.
314
+
315
+ Adjust wait_for_status() to handle a specific list of hosts rather than
316
+ just @hosts.
317
+ ```
318
+ * (BKR-217) aws_sdk: add create_instance() (d4d6521d)
319
+
320
+
321
+ ```
322
+ (BKR-217) aws_sdk: add create_instance()
323
+
324
+ Move the per-host core of launch_all_nodes() to create_instance() to
325
+ prepare for the addition of launch exception
326
+ handlers (InsufficientCapacity, etc.).
327
+ ```
328
+ * (BKR-217) aws_sdk: move wait_for_status() to launch_all_nodes() (023437e1)
329
+
330
+ * (maint) Allow :ruby_arch to select Windows builds (a0d76866)
331
+
332
+
333
+ ```
334
+ (maint) Allow :ruby_arch to select Windows builds
335
+
336
+ - Puppet puppetlabs/puppet@92c539f8626467690321c875d5f2746f56fec6ac
337
+ added :ruby_arch to support the notion of choosing a Windows
338
+ installer architecture. A node could set :ruby_arch to either
339
+ x64 or x86 to choose to install a 64-bit or 32-bit Ruby MSI on a
340
+ 64-bit version of Windows.
341
+
342
+ When similar behavior was introduced to Beaker, it didn't follow
343
+ prior art, and a new setting called :install_32 was introduced to
344
+ manage this functionality in 6f8deb7dbc7bc75b8624df754c261f4d2b58b999
345
+
346
+ This commit adds in :ruby_arch, with the hope that :install_32 will
347
+ be deprecated on a future major version boundary to simplify the
348
+ logic around settings evaluation here.
349
+ ```
350
+ * (maint) Allow installing 32-bit Puppet Agent (23c06fa9)
351
+
352
+
353
+ ```
354
+ (maint) Allow installing 32-bit Puppet Agent
355
+
356
+ - Previously, install_utils was modified to be able to install PE
357
+ based on a configuration switch called `install_32` in
358
+ 6f8deb7dbc7bc75b8624df754c261f4d2b58b999
359
+
360
+ This allows a 64-bit Windows OS to ask to install a 32-bit Ruby /
361
+ Puppet version. This is important given 64-bit support wasn't
362
+ added to Puppet or PE until 3.7.
363
+
364
+ When installing the puppet-agent through install_puppetagent_dev_repo
365
+ helper, allow for selecting the build in a similar fashion.
366
+ ```
367
+ ### <a name = "2.10.0">2.10.0 - 22 Apr, 2015 (c4f37479)
368
+
369
+ * (HISTORY) update beaker history for gem release 2.10.0 (c4f37479)
82
370
 
83
371
  * (GEM) update beaker version to 2.10.0 (2f834676)
84
372
 
@@ -250,8 +538,6 @@ Further reading if interested:
250
538
  http://www.secnetix.de/olli/FreeBSD/mnamelen.hawk
251
539
  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=167105
252
540
  ```
253
- * (MAINT) Changes msi install commands run when on non-cygwin (89dabc69)
254
-
255
541
  * (MAINT) Changes msi install commands ran... (effcde41)
256
542
 
257
543
 
@@ -260,6 +546,8 @@ https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=167105
260
546
 
261
547
  When on non-cygwin Windows, use `start` not cmd
262
548
  ```
549
+ * (MAINT) Changes msi install commands run when on non-cygwin (89dabc69)
550
+
263
551
  * (gh-732) Better Openstack IP address assignment (e1fcd580)
264
552
 
265
553
  * (gh-687) [openstack] Previously, the method attemped to set root on all nodes, even if the node was not up yet (802db0e9)
@@ -27,6 +27,7 @@ end
27
27
 
28
28
  step "#add_env_var : can add an environment variable"
29
29
  hosts.each do |host|
30
+ host.clear_env_var("test")
30
31
  logger.debug("add TEST=1")
31
32
  host.add_env_var("TEST", "1")
32
33
  logger.debug("add TEST=1 again (shouldn't create duplicate entry)")
@@ -50,8 +50,8 @@ module Beaker
50
50
 
51
51
  # Master/dashboard answers
52
52
  master_console_a = {
53
- :q_puppetdb_hostname => database,
54
- :q_puppetdb_port => answer_for(options, :q_puppetdb_port, 8081)
53
+ :q_puppetdb_hostname => answer_for(options, :q_puppetdb_hostname, database),
54
+ :q_puppetdb_port => answer_for(options, :q_puppetdb_port, 8081)
55
55
  }
56
56
 
57
57
  # Master only answers
@@ -76,16 +76,16 @@ module Beaker
76
76
 
77
77
  console_database_a = {
78
78
  :q_puppetdb_database_name => database_name,
79
- :q_puppetdb_database_user => database_user,
80
- :q_puppetdb_database_password => puppetdb_password,
79
+ :q_puppetdb_database_user => answer_for(options, :q_puppetdb_database_user, database_user),
80
+ :q_puppetdb_database_password => answer_for(options, :q_puppetdb_database_password, puppetdb_password),
81
81
  :q_puppet_enterpriseconsole_auth_database_name => auth_database_name,
82
82
  :q_puppet_enterpriseconsole_auth_database_user => auth_database_user,
83
- :q_puppet_enterpriseconsole_auth_database_password => dashboard_password,
83
+ :q_puppet_enterpriseconsole_auth_database_password => answer_for(options, :q_puppet_enterpriseconsole_auth_database_password, dashboard_password),
84
84
  :q_puppet_enterpriseconsole_database_name => console_database_name,
85
- :q_puppet_enterpriseconsole_database_user => console_database_user,
86
- :q_puppet_enterpriseconsole_database_password => dashboard_password,
85
+ :q_puppet_enterpriseconsole_database_user => answer_for(options, :q_puppet_enterpriseconsole_database_user, console_database_user),
86
+ :q_puppet_enterpriseconsole_database_password => answer_for(options, :q_puppet_enterpriseconsole_database_password, dashboard_password),
87
87
 
88
- :q_database_host => database,
88
+ :q_database_host => answer_for(options, :q_database_host, database),
89
89
  :q_database_port => database_port,
90
90
  }
91
91
 
@@ -130,7 +130,7 @@ module Beaker
130
130
  # Database only answers
131
131
  database_a = {
132
132
  :q_puppetdb_install => 'y',
133
- :q_database_install => 'y',
133
+ :q_database_install => answer_for(options, :q_database_install, 'y'),
134
134
  :q_database_root_password => "'#{answer_for(options, :q_database_root_password, '=ZYdjiP3jCwV5eo9s1MBd')}'",
135
135
  :q_database_root_user => answer_for(options, :q_database_root_user, 'pe-postgres'),
136
136
  }
@@ -158,7 +158,7 @@ module Beaker
158
158
  if host == dashboard
159
159
  answers.merge! master_console_a
160
160
  answers.merge! console_database_a
161
- answers[:q_pe_database] = 'y'
161
+ answers[:q_pe_database] = answer_for(options, :q_pe_database, 'y')
162
162
  unless options[:type] == :upgrade
163
163
  answers.merge! console_a
164
164
  else
@@ -111,6 +111,8 @@ module Beaker
111
111
  if @network_manager
112
112
  @network_manager.cleanup
113
113
  end
114
+ else
115
+ preserve_hosts_file
114
116
  end
115
117
 
116
118
  @perf.print_perf_info if @options[:collect_perf_data]
@@ -127,7 +129,7 @@ module Beaker
127
129
  @network_manager.cleanup
128
130
  end
129
131
  else
130
- preserve_hosts_file if @options[:provision]
132
+ preserve_hosts_file
131
133
  end
132
134
 
133
135
  if @logger.is_debug?
@@ -159,7 +161,7 @@ module Beaker
159
161
  #
160
162
  # @return nil
161
163
  def preserve_hosts_file
162
- preserved_hosts_filename = File.join(@options[:log_dated_dir], File.basename(@options[:hosts_file]))
164
+ preserved_hosts_filename = File.join(@options[:log_dated_dir], 'hosts_preserved.yml')
163
165
  FileUtils.cp(@options[:hosts_file], preserved_hosts_filename)
164
166
  hosts_yaml = YAML.load_file(preserved_hosts_filename)
165
167
  newly_keyed_hosts_entries = {}
@@ -172,6 +174,8 @@ module Beaker
172
174
  end
173
175
  end
174
176
  hosts_yaml['HOSTS'] = newly_keyed_hosts_entries
177
+ hosts_yaml['CONFIG'] ||= {}
178
+ hosts_yaml['CONFIG']['provision'] = false
175
179
  File.open(preserved_hosts_filename, 'w') do |file|
176
180
  YAML.dump(hosts_yaml, file)
177
181
  end
@@ -253,8 +257,9 @@ module Beaker
253
257
 
254
258
  # provides a new version of the command given, edited for re-use with a
255
259
  # preserved host. It does this by swapping the hosts file out for the
256
- # new_hostsfile argument and setting the --no-provision flag, removing
257
- # any previously set provisioning flags that it finds.
260
+ # new_hostsfile argument and removing any previously set provisioning
261
+ # flags that it finds
262
+ # (we add +:provision => false+ in the new_hostsfile itself).
258
263
  #
259
264
  # @param [String] command Command line parameters to edit.
260
265
  # @param [String] new_hostsfile Path to the new hosts file to use.
@@ -262,7 +267,6 @@ module Beaker
262
267
  # @return [String] The command line parameters edited for re-use
263
268
  def build_hosts_preserved_reproducing_command(command, new_hostsfile)
264
269
  command_parts = command.split(' ')
265
- has_no_provision_flag = false
266
270
  replace_hosts_file_next = false
267
271
  reproducing_command = []
268
272
  command_parts.each do |part|
@@ -271,14 +275,12 @@ module Beaker
271
275
  replace_hosts_file_next = false
272
276
  next
273
277
  elsif part == '--provision' || part == '--no-provision'
274
- has_no_provision_flag = true
275
- next
278
+ next # skip any provisioning flag. This is handled in the new_hostsfile itself
276
279
  elsif part == '--hosts'
277
280
  replace_hosts_file_next = true
278
281
  end
279
282
  reproducing_command << part
280
283
  end
281
- reproducing_command << '--no-provision' unless has_no_provision_flag
282
284
  reproducing_command.join(' ')
283
285
  end
284
286
  end