chef 12.1.2 → 12.2.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +7 -0
  2. data/lib/chef/application/client.rb +2 -2
  3. data/lib/chef/audit/audit_reporter.rb +1 -1
  4. data/lib/chef/audit/runner.rb +15 -2
  5. data/lib/chef/client.rb +1 -1
  6. data/lib/chef/config.rb +6 -4
  7. data/lib/chef/dsl/powershell.rb +29 -0
  8. data/lib/chef/exceptions.rb +18 -3
  9. data/lib/chef/formatters/doc.rb +2 -2
  10. data/lib/chef/knife/bootstrap.rb +2 -1
  11. data/lib/chef/knife/bootstrap/templates/chef-full.erb +1 -1
  12. data/lib/chef/knife/core/subcommand_loader.rb +13 -5
  13. data/lib/chef/knife/exec.rb +2 -1
  14. data/lib/chef/knife/ssh.rb +12 -2
  15. data/lib/chef/mixin/params_validate.rb +42 -19
  16. data/lib/chef/mixin/powershell_type_coercions.rb +82 -0
  17. data/lib/chef/mixin/windows_architecture_helper.rb +8 -0
  18. data/lib/chef/node.rb +1 -1
  19. data/lib/chef/platform/provider_mapping.rb +0 -107
  20. data/lib/chef/platform/query_helpers.rb +7 -0
  21. data/lib/chef/provider/batch.rb +2 -0
  22. data/lib/chef/provider/cron.rb +2 -0
  23. data/lib/chef/provider/cron/aix.rb +2 -0
  24. data/lib/chef/provider/cron/unix.rb +2 -0
  25. data/lib/chef/provider/deploy.rb +104 -87
  26. data/lib/chef/provider/dsc_resource.rb +157 -0
  27. data/lib/chef/provider/env.rb +2 -0
  28. data/lib/chef/provider/env/windows.rb +2 -0
  29. data/lib/chef/provider/git.rb +4 -0
  30. data/lib/chef/provider/group.rb +5 -5
  31. data/lib/chef/provider/group/dscl.rb +2 -0
  32. data/lib/chef/provider/group/groupmod.rb +2 -0
  33. data/lib/chef/provider/group/usermod.rb +2 -0
  34. data/lib/chef/provider/group/windows.rb +2 -0
  35. data/lib/chef/provider/mdadm.rb +2 -0
  36. data/lib/chef/provider/mount/windows.rb +2 -0
  37. data/lib/chef/provider/package/homebrew.rb +1 -1
  38. data/lib/chef/provider/package/openbsd.rb +49 -18
  39. data/lib/chef/provider/package/rubygems.rb +7 -2
  40. data/lib/chef/provider/powershell_script.rb +2 -0
  41. data/lib/chef/provider/service/macosx.rb +1 -2
  42. data/lib/chef/provider/user/dscl.rb +7 -1
  43. data/lib/chef/provider/user/windows.rb +2 -0
  44. data/lib/chef/providers.rb +1 -0
  45. data/lib/chef/recipe.rb +2 -0
  46. data/lib/chef/resource.rb +9 -0
  47. data/lib/chef/resource/batch.rb +2 -0
  48. data/lib/chef/resource/cron.rb +3 -3
  49. data/lib/chef/resource/deploy.rb +52 -217
  50. data/lib/chef/resource/dsc_resource.rb +83 -0
  51. data/lib/chef/resource/env.rb +2 -0
  52. data/lib/chef/resource/git.rb +1 -1
  53. data/lib/chef/resource/group.rb +2 -0
  54. data/lib/chef/resource/homebrew_package.rb +1 -1
  55. data/lib/chef/resource/lwrp_base.rb +0 -8
  56. data/lib/chef/resource/mdadm.rb +2 -0
  57. data/lib/chef/resource/mount.rb +2 -0
  58. data/lib/chef/resource/powershell_script.rb +2 -0
  59. data/lib/chef/resource/user.rb +2 -0
  60. data/lib/chef/resources.rb +1 -0
  61. data/lib/chef/run_context.rb +1 -1
  62. data/lib/chef/shell.rb +7 -5
  63. data/lib/chef/util/dsc/resource_store.rb +110 -0
  64. data/lib/chef/util/path_helper.rb +76 -0
  65. data/lib/chef/util/powershell/cmdlet.rb +41 -7
  66. data/lib/chef/util/powershell/cmdlet_result.rb +18 -3
  67. data/lib/chef/util/powershell/ps_credential.rb +38 -0
  68. data/lib/chef/version.rb +1 -1
  69. data/lib/chef/win32/api.rb +2 -0
  70. data/lib/chef/win32/api/crypto.rb +63 -0
  71. data/lib/chef/win32/api/installer.rb +1 -1
  72. data/lib/chef/win32/crypto.rb +49 -0
  73. data/lib/chef/workstation_config_loader.rb +4 -3
  74. data/spec/functional/file_content_management/deploy_strategies_spec.rb +1 -1
  75. data/spec/functional/resource/cookbook_file_spec.rb +1 -1
  76. data/spec/functional/resource/deploy_revision_spec.rb +35 -0
  77. data/spec/functional/resource/directory_spec.rb +1 -1
  78. data/spec/functional/resource/dsc_resource_spec.rb +93 -0
  79. data/spec/functional/resource/env_spec.rb +4 -3
  80. data/spec/functional/resource/file_spec.rb +1 -1
  81. data/spec/functional/resource/powershell_spec.rb +2 -1
  82. data/spec/functional/resource/remote_directory_spec.rb +1 -1
  83. data/spec/functional/resource/remote_file_spec.rb +1 -1
  84. data/spec/functional/resource/template_spec.rb +1 -1
  85. data/spec/functional/resource/user/dscl_spec.rb +1 -2
  86. data/spec/functional/resource/user/useradd_spec.rb +27 -13
  87. data/spec/functional/util/powershell/cmdlet_spec.rb +3 -3
  88. data/spec/functional/win32/crypto_spec.rb +57 -0
  89. data/spec/spec_helper.rb +3 -0
  90. data/spec/support/platform_helpers.rb +14 -0
  91. data/spec/support/shared/functional/securable_resource_with_reporting.rb +5 -5
  92. data/spec/unit/application/client_spec.rb +4 -4
  93. data/spec/unit/audit/audit_reporter_spec.rb +1 -1
  94. data/spec/unit/audit/runner_spec.rb +10 -0
  95. data/spec/unit/config_spec.rb +2 -8
  96. data/spec/unit/knife/bootstrap_spec.rb +20 -8
  97. data/spec/unit/knife/core/subcommand_loader_spec.rb +29 -29
  98. data/spec/unit/mixin/params_validate_spec.rb +75 -61
  99. data/spec/unit/mixin/powershell_type_coercions_spec.rb +72 -0
  100. data/spec/unit/platform/query_helpers_spec.rb +22 -0
  101. data/spec/unit/platform_spec.rb +0 -5
  102. data/spec/unit/provider/dsc_resource_spec.rb +84 -0
  103. data/spec/unit/provider/package/openbsd_spec.rb +105 -17
  104. data/spec/unit/provider/service/macosx_spec.rb +3 -3
  105. data/spec/unit/provider_resolver_spec.rb +132 -0
  106. data/spec/unit/recipe_spec.rb +4 -0
  107. data/spec/unit/resource/deploy_spec.rb +27 -0
  108. data/spec/unit/resource/dsc_resource_spec.rb +85 -0
  109. data/spec/unit/shell_spec.rb +1 -1
  110. data/spec/unit/util/dsc/resource_store.rb +76 -0
  111. data/spec/unit/util/powershell/ps_credential_spec.rb +37 -0
  112. data/spec/unit/workstation_config_loader_spec.rb +1 -1
  113. metadata +159 -186
@@ -44,6 +44,8 @@ class Chef
44
44
  # This provider only supports Mac OSX versions 10.7 and above
45
45
  class Dscl < Chef::Provider::User
46
46
 
47
+ provides :user, os: "darwin"
48
+
47
49
  def define_resource_requirements
48
50
  super
49
51
 
@@ -650,7 +652,11 @@ user password using shadow hash.")
650
652
  def run_plutil(*args)
651
653
  result = shell_out("plutil -#{args.join(' ')}")
652
654
  raise(Chef::Exceptions::PlistUtilCommandFailed,"plutil error: #{result.inspect}") unless result.exitstatus == 0
653
- result.stdout
655
+ if result.stdout.encoding == Encoding::ASCII_8BIT
656
+ result.stdout.encode("utf-8", "binary", :undef => :replace, :invalid => :replace, :replace => '?')
657
+ else
658
+ result.stdout
659
+ end
654
660
  end
655
661
 
656
662
  def convert_binary_plist_to_xml(binary_plist_string)
@@ -27,6 +27,8 @@ class Chef
27
27
  class User
28
28
  class Windows < Chef::Provider::User
29
29
 
30
+ provides :user, os: "windows"
31
+
30
32
  def initialize(new_resource,run_context)
31
33
  super
32
34
  @net_user = Chef::Util::Windows::NetUser.new(@new_resource.username)
@@ -25,6 +25,7 @@ require 'chef/provider/cron/aix'
25
25
  require 'chef/provider/deploy'
26
26
  require 'chef/provider/directory'
27
27
  require 'chef/provider/dsc_script'
28
+ require 'chef/provider/dsc_resource'
28
29
  require 'chef/provider/env'
29
30
  require 'chef/provider/erl_call'
30
31
  require 'chef/provider/execute'
@@ -25,6 +25,7 @@ require 'chef/dsl/include_recipe'
25
25
  require 'chef/dsl/registry_helper'
26
26
  require 'chef/dsl/reboot_pending'
27
27
  require 'chef/dsl/audit'
28
+ require 'chef/dsl/powershell'
28
29
 
29
30
  require 'chef/mixin/from_file'
30
31
 
@@ -42,6 +43,7 @@ class Chef
42
43
  include Chef::DSL::RegistryHelper
43
44
  include Chef::DSL::RebootPending
44
45
  include Chef::DSL::Audit
46
+ include Chef::DSL::Powershell
45
47
 
46
48
  include Chef::Mixin::FromFile
47
49
  include Chef::Mixin::Deprecation
@@ -996,6 +996,15 @@ class Chef
996
996
  end
997
997
  end
998
998
 
999
+ #
1000
+ # DSL method used to define attribute on a resource wrapping params_validate
1001
+ #
1002
+ def self.attribute(attr_name, validation_opts={})
1003
+ define_method(attr_name) do |arg=NULL_ARG|
1004
+ nillable_set_or_return(attr_name.to_sym, arg, validation_opts)
1005
+ end
1006
+ end
1007
+
999
1008
  #
1000
1009
  # The cookbook in which this Resource was defined (if any).
1001
1010
  #
@@ -22,6 +22,8 @@ class Chef
22
22
  class Resource
23
23
  class Batch < Chef::Resource::WindowsScript
24
24
 
25
+ provides :batch, os: "windows"
26
+
25
27
  def initialize(name, run_context=nil)
26
28
  super(name, run_context, :batch, "cmd.exe")
27
29
  end
@@ -27,6 +27,8 @@ class Chef
27
27
 
28
28
  state_attrs :minute, :hour, :day, :month, :weekday, :user
29
29
 
30
+ provides :cron
31
+
30
32
  def initialize(name, run_context=nil)
31
33
  super
32
34
  @resource_name = :cron
@@ -138,7 +140,7 @@ class Chef
138
140
  :kind_of => [String, Symbol]
139
141
  )
140
142
  end
141
-
143
+
142
144
  def time(arg=nil)
143
145
  set_or_return(
144
146
  :time,
@@ -214,5 +216,3 @@ class Chef
214
216
  end
215
217
  end
216
218
  end
217
-
218
-
@@ -63,6 +63,7 @@ class Chef
63
63
  @deploy_to = name
64
64
  @environment = nil
65
65
  @repository_cache = 'cached-copy'
66
+ # XXX: if copy_exclude is a kind_of String why is initialized to an array???
66
67
  @copy_exclude = []
67
68
  @purge_before_symlink = %w{log tmp/pids public/system}
68
69
  @create_dirs_before_symlink = %w{tmp public config}
@@ -78,10 +79,11 @@ class Chef
78
79
  @scm_provider = Chef::Provider::Git
79
80
  @svn_force_export = false
80
81
  @allowed_actions.push(:force_deploy, :deploy, :rollback)
81
- @additional_remotes = Hash[]
82
+ @additional_remotes = {}
82
83
  @keep_releases = 5
83
84
  @enable_checkout = true
84
85
  @checkout_branch = "deploy"
86
+ @timeout = nil
85
87
  end
86
88
 
87
89
  # where the checked out/cloned code goes
@@ -104,42 +106,18 @@ class Chef
104
106
  end
105
107
 
106
108
  # note: deploy_to is your application "meta-root."
107
- def deploy_to(arg=nil)
108
- set_or_return(
109
- :deploy_to,
110
- arg,
111
- :kind_of => [ String ]
112
- )
113
- end
109
+ attribute :deploy_to, :kind_of => [ String ]
114
110
 
115
- def repo(arg=nil)
116
- set_or_return(
117
- :repo,
118
- arg,
119
- :kind_of => [ String ]
120
- )
121
- end
111
+ attribute :repo, :kind_of => [ String ]
122
112
  alias :repository :repo
123
113
 
124
- def remote(arg=nil)
125
- set_or_return(
126
- :remote,
127
- arg,
128
- :kind_of => [ String ]
129
- )
130
- end
114
+ attribute :remote, :kind_of => [ String ]
131
115
 
132
- def role(arg=nil)
133
- set_or_return(
134
- :role,
135
- arg,
136
- :kind_of => [ String ]
137
- )
138
- end
116
+ attribute :role, :kind_of => [ String ]
139
117
 
140
- def restart_command(arg=nil, &block)
141
- arg ||= block
142
- set_or_return(
118
+ def restart_command(arg=NULL_ARG, &block)
119
+ arg = block if block_given?
120
+ nillable_set_or_return(
143
121
  :restart_command,
144
122
  arg,
145
123
  :kind_of => [ String, Proc ]
@@ -147,155 +125,60 @@ class Chef
147
125
  end
148
126
  alias :restart :restart_command
149
127
 
150
- def migrate(arg=nil)
151
- set_or_return(
152
- :migrate,
153
- arg,
154
- :kind_of => [ TrueClass, FalseClass ]
155
- )
156
- end
128
+ attribute :migrate, :kind_of => [ TrueClass, FalseClass ]
157
129
 
158
- def migration_command(arg=nil)
159
- set_or_return(
160
- :migration_command,
161
- arg,
162
- :kind_of => [ String ]
163
- )
164
- end
130
+ attribute :migration_command, kind_of: String
165
131
 
166
- def rollback_on_error(arg=nil)
167
- set_or_return(
168
- :rollback_on_error,
169
- arg,
170
- :kind_of => [ TrueClass, FalseClass ]
171
- )
172
- end
132
+ attribute :rollback_on_error, :kind_of => [ TrueClass, FalseClass ]
173
133
 
174
- def user(arg=nil)
175
- set_or_return(
176
- :user,
177
- arg,
178
- :kind_of => [ String ]
179
- )
180
- end
134
+ attribute :user, kind_of: String
181
135
 
182
- def group(arg=nil)
183
- set_or_return(
184
- :group,
185
- arg,
186
- :kind_of => [ String ]
187
- )
188
- end
136
+ attribute :group, kind_of: [ String ]
189
137
 
190
- def enable_submodules(arg=nil)
191
- set_or_return(
192
- :enable_submodules,
193
- arg,
194
- :kind_of => [ TrueClass, FalseClass ]
195
- )
196
- end
138
+ attribute :enable_submodules, kind_of: [ TrueClass, FalseClass ]
197
139
 
198
- def shallow_clone(arg=nil)
199
- set_or_return(
200
- :shallow_clone,
201
- arg,
202
- :kind_of => [ TrueClass, FalseClass ]
203
- )
204
- end
140
+ attribute :shallow_clone, kind_of: [ TrueClass, FalseClass ]
205
141
 
206
- def repository_cache(arg=nil)
207
- set_or_return(
208
- :repository_cache,
209
- arg,
210
- :kind_of => [ String ]
211
- )
212
- end
142
+ attribute :repository_cache, kind_of: String
213
143
 
214
- def copy_exclude(arg=nil)
215
- set_or_return(
216
- :copy_exclude,
217
- arg,
218
- :kind_of => [ String ]
219
- )
220
- end
144
+ attribute :copy_exclude, kind_of: String
221
145
 
222
- def revision(arg=nil)
223
- set_or_return(
224
- :revision,
225
- arg,
226
- :kind_of => [ String ]
227
- )
228
- end
146
+ attribute :revision, kind_of: String
229
147
  alias :branch :revision
230
148
 
231
- def git_ssh_wrapper(arg=nil)
232
- set_or_return(
233
- :git_ssh_wrapper,
234
- arg,
235
- :kind_of => [ String ]
236
- )
237
- end
149
+ attribute :git_ssh_wrapper, kind_of: String
238
150
  alias :ssh_wrapper :git_ssh_wrapper
239
151
 
240
- def svn_username(arg=nil)
241
- set_or_return(
242
- :svn_username,
243
- arg,
244
- :kind_of => [ String ]
245
- )
246
- end
152
+ attribute :svn_username, kind_of: String
247
153
 
248
- def svn_password(arg=nil)
249
- set_or_return(
250
- :svn_password,
251
- arg,
252
- :kind_of => [ String ]
253
- )
254
- end
154
+ attribute :svn_password, kind_of: String
255
155
 
256
- def svn_arguments(arg=nil)
257
- set_or_return(
258
- :svn_arguments,
259
- arg,
260
- :kind_of => [ String ]
261
- )
262
- end
156
+ attribute :svn_arguments, kind_of: String
263
157
 
264
- def svn_info_args(arg=nil)
265
- set_or_return(
266
- :svn_arguments,
267
- arg,
268
- :kind_of => [ String ])
269
- end
158
+ attribute :svn_info_args, kind_of: String
270
159
 
271
- def scm_provider(arg=nil)
160
+ def scm_provider(arg=NULL_ARG)
272
161
  klass = if arg.kind_of?(String) || arg.kind_of?(Symbol)
273
162
  lookup_provider_constant(arg)
274
163
  else
275
164
  arg
276
165
  end
277
- set_or_return(
166
+ nillable_set_or_return(
278
167
  :scm_provider,
279
168
  klass,
280
169
  :kind_of => [ Class ]
281
170
  )
282
171
  end
283
172
 
284
- def svn_force_export(arg=nil)
285
- set_or_return(
286
- :svn_force_export,
287
- arg,
288
- :kind_of => [ TrueClass, FalseClass ]
289
- )
290
- end
173
+ attribute :svn_force_export, kind_of: [ TrueClass, FalseClass ]
291
174
 
292
- def environment(arg=nil)
175
+ def environment(arg=NULL_ARG)
293
176
  if arg.is_a?(String)
294
177
  Chef::Log.debug "Setting RAILS_ENV, RACK_ENV, and MERB_ENV to `#{arg}'"
295
178
  Chef::Log.warn "[DEPRECATED] please modify your deploy recipe or attributes to set the environment using a hash"
296
179
  arg = {"RAILS_ENV"=>arg,"MERB_ENV"=>arg,"RACK_ENV"=>arg}
297
180
  end
298
- set_or_return(
181
+ nillable_set_or_return(
299
182
  :environment,
300
183
  arg,
301
184
  :kind_of => [ Hash ]
@@ -303,8 +186,8 @@ class Chef
303
186
  end
304
187
 
305
188
  # The number of old release directories to keep around after cleanup
306
- def keep_releases(arg=nil)
307
- [set_or_return(
189
+ def keep_releases(arg=NULL_ARG)
190
+ [nillable_set_or_return(
308
191
  :keep_releases,
309
192
  arg,
310
193
  :kind_of => [ Integer ]), 1].max
@@ -314,13 +197,7 @@ class Chef
314
197
  # SCM clone/checkout before symlinking. Use this to get rid of files and
315
198
  # directories you want to be shared between releases.
316
199
  # Default: ["log", "tmp/pids", "public/system"]
317
- def purge_before_symlink(arg=nil)
318
- set_or_return(
319
- :purge_before_symlink,
320
- arg,
321
- :kind_of => Array
322
- )
323
- end
200
+ attribute :purge_before_symlink, kind_of: Array
324
201
 
325
202
  # An array of paths, relative to your app's root, where you expect dirs to
326
203
  # exist before symlinking. This runs after #purge_before_symlink, so you
@@ -330,13 +207,7 @@ class Chef
330
207
  # then specify tmp here so that the tmp directory will exist when you
331
208
  # symlink the pids directory in to the current release.
332
209
  # Default: ["tmp", "public", "config"]
333
- def create_dirs_before_symlink(arg=nil)
334
- set_or_return(
335
- :create_dirs_before_symlink,
336
- arg,
337
- :kind_of => Array
338
- )
339
- end
210
+ attribute :create_dirs_before_symlink, kind_of: Array
340
211
 
341
212
  # A Hash of shared/dir/path => release/dir/path. This attribute determines
342
213
  # which files and dirs in the shared directory get symlinked to the current
@@ -344,13 +215,7 @@ class Chef
344
215
  # $shared/pids that you would like to symlink as $current_release/tmp/pids
345
216
  # you specify it as "pids" => "tmp/pids"
346
217
  # Default {"system" => "public/system", "pids" => "tmp/pids", "log" => "log"}
347
- def symlinks(arg=nil)
348
- set_or_return(
349
- :symlinks,
350
- arg,
351
- :kind_of => Hash
352
- )
353
- end
218
+ attribute :symlinks, kind_of: Hash
354
219
 
355
220
  # A Hash of shared/dir/path => release/dir/path. This attribute determines
356
221
  # which files in the shared directory get symlinked to the current release
@@ -359,74 +224,44 @@ class Chef
359
224
  # For a rails/merb app, this is used to link in a known good database.yml
360
225
  # (with the production db password) before running migrate.
361
226
  # Default {"config/database.yml" => "config/database.yml"}
362
- def symlink_before_migrate(arg=nil)
363
- set_or_return(
364
- :symlink_before_migrate,
365
- arg,
366
- :kind_of => Hash
367
- )
368
- end
227
+ attribute :symlink_before_migrate, kind_of: Hash
369
228
 
370
229
  # Callback fires before migration is run.
371
- def before_migrate(arg=nil, &block)
372
- arg ||= block
373
- set_or_return(:before_migrate, arg, :kind_of => [Proc, String])
230
+ def before_migrate(arg=NULL_ARG, &block)
231
+ arg = block if block_given?
232
+ nillable_set_or_return(:before_migrate, arg, kind_of: [Proc, String])
374
233
  end
375
234
 
376
235
  # Callback fires before symlinking
377
- def before_symlink(arg=nil, &block)
378
- arg ||= block
379
- set_or_return(:before_symlink, arg, :kind_of => [Proc, String])
236
+ def before_symlink(arg=NULL_ARG, &block)
237
+ arg = block if block_given?
238
+ nillable_set_or_return(:before_symlink, arg, kind_of: [Proc, String])
380
239
  end
381
240
 
382
241
  # Callback fires before restart
383
- def before_restart(arg=nil, &block)
384
- arg ||= block
385
- set_or_return(:before_restart, arg, :kind_of => [Proc, String])
242
+ def before_restart(arg=NULL_ARG, &block)
243
+ arg = block if block_given?
244
+ nillable_set_or_return(:before_restart, arg, kind_of: [Proc, String])
386
245
  end
387
246
 
388
247
  # Callback fires after restart
389
- def after_restart(arg=nil, &block)
390
- arg ||= block
391
- set_or_return(:after_restart, arg, :kind_of => [Proc, String])
248
+ def after_restart(arg=NULL_ARG, &block)
249
+ arg = block if block_given?
250
+ nillable_set_or_return(:after_restart, arg, kind_of: [Proc, String])
392
251
  end
393
252
 
394
- def additional_remotes(arg=nil)
395
- set_or_return(
396
- :additional_remotes,
397
- arg,
398
- :kind_of => Hash
399
- )
400
- end
253
+ attribute :additional_remotes, kind_of: Hash
401
254
 
402
- def enable_checkout(arg=nil)
403
- set_or_return(
404
- :enable_checkout,
405
- arg,
406
- :kind_of => [TrueClass, FalseClass]
407
- )
408
- end
255
+ attribute :enable_checkout, kind_of: [ TrueClass, FalseClass ]
409
256
 
410
- def checkout_branch(arg=nil)
411
- set_or_return(
412
- :checkout_branch,
413
- arg,
414
- :kind_of => String
415
- )
416
- end
257
+ attribute :checkout_branch, kind_of: String
417
258
 
418
259
  # FIXME The Deploy resource may be passed to an SCM provider as its
419
260
  # resource. The SCM provider knows that SCM resources can specify a
420
261
  # timeout for SCM operations. The deploy resource must therefore support
421
262
  # a timeout method, but the timeout it describes is for SCM operations,
422
263
  # not the overall deployment. This is potentially confusing.
423
- def timeout(arg=nil)
424
- set_or_return(
425
- :timeout,
426
- arg,
427
- :kind_of => Integer
428
- )
429
- end
264
+ attribute :timeout, kind_of: Integer
430
265
 
431
266
  end
432
267
  end