puppet 4.0.0 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/ext/build_defaults.yaml +8 -35
- data/ext/debian/puppet.default +0 -5
- data/ext/debian/puppet.init +1 -15
- data/lib/hiera/puppet_function.rb +15 -4
- data/lib/puppet/application/agent.rb +5 -0
- data/lib/puppet/application/apply.rb +23 -2
- data/lib/puppet/application/device.rb +8 -3
- data/lib/puppet/application/master.rb +16 -5
- data/lib/puppet/configurer.rb +7 -5
- data/lib/puppet/defaults.rb +18 -0
- data/lib/puppet/environments.rb +1 -1
- data/lib/puppet/error.rb +27 -1
- data/lib/puppet/file_serving/metadata.rb +13 -8
- data/lib/puppet/file_serving/terminus_helper.rb +7 -8
- data/lib/puppet/file_system.rb +13 -0
- data/lib/puppet/file_system/file_impl.rb +4 -0
- data/lib/puppet/file_system/memory_impl.rb +4 -0
- data/lib/puppet/file_system/windows.rb +8 -0
- data/lib/puppet/functions.rb +33 -3
- data/lib/puppet/functions/defined.rb +130 -0
- data/lib/puppet/functions/regsubst.rb +1 -1
- data/lib/puppet/functions/split.rb +1 -1
- data/lib/puppet/indirector/catalog/compiler.rb +1 -1
- data/lib/puppet/indirector/facts/facter.rb +11 -0
- data/lib/puppet/loaders.rb +1 -0
- data/lib/puppet/node.rb +17 -1
- data/lib/puppet/node/environment.rb +4 -0
- data/lib/puppet/parser/ast/pops_bridge.rb +4 -0
- data/lib/puppet/parser/compiler.rb +9 -0
- data/lib/puppet/parser/functions/defined.rb +25 -1
- data/lib/puppet/parser/functions/file.rb +3 -1
- data/lib/puppet/parser/scope.rb +11 -2
- data/lib/puppet/parser/templatewrapper.rb +2 -1
- data/lib/puppet/pops.rb +4 -0
- data/lib/puppet/pops/evaluator/access_operator.rb +25 -5
- data/lib/puppet/pops/evaluator/closure.rb +28 -2
- data/lib/puppet/pops/evaluator/collector_transformer.rb +1 -11
- data/lib/puppet/pops/evaluator/collectors/catalog_collector.rb +4 -0
- data/lib/puppet/pops/evaluator/collectors/exported_collector.rb +4 -0
- data/lib/puppet/pops/evaluator/compare_operator.rb +43 -0
- data/lib/puppet/pops/evaluator/epp_evaluator.rb +7 -2
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +48 -14
- data/lib/puppet/pops/evaluator/runtime3_support.rb +10 -5
- data/lib/puppet/pops/functions/dispatch.rb +6 -1
- data/lib/puppet/pops/functions/dispatcher.rb +7 -1
- data/lib/puppet/pops/issue_reporter.rb +42 -16
- data/lib/puppet/pops/issues.rb +116 -2
- data/lib/puppet/pops/loader/loader.rb +11 -0
- data/lib/puppet/pops/loader/loader_paths.rb +67 -6
- data/lib/puppet/pops/loader/module_loaders.rb +19 -8
- data/lib/puppet/pops/loader/puppet_function_instantiator.rb +78 -0
- data/lib/puppet/pops/loaders.rb +6 -4
- data/lib/puppet/pops/migration/migration_checker.rb +54 -0
- data/lib/puppet/pops/model/factory.rb +5 -1
- data/lib/puppet/pops/model/model_label_provider.rb +2 -0
- data/lib/puppet/pops/model/model_meta.rb +5 -1
- data/lib/puppet/pops/parser/egrammar.ra +9 -10
- data/lib/puppet/pops/parser/eparser.rb +1061 -1047
- data/lib/puppet/pops/parser/epp_support.rb +18 -9
- data/lib/puppet/pops/parser/evaluating_parser.rb +7 -1
- data/lib/puppet/pops/parser/heredoc_support.rb +12 -11
- data/lib/puppet/pops/parser/interpolation_support.rb +7 -1
- data/lib/puppet/pops/parser/lexer2.rb +29 -12
- data/lib/puppet/pops/parser/lexer_support.rb +52 -23
- data/lib/puppet/pops/parser/parser_support.rb +11 -14
- data/lib/puppet/pops/parser/slurp_support.rb +22 -6
- data/lib/puppet/pops/types/type_calculator.rb +156 -55
- data/lib/puppet/pops/types/type_factory.rb +66 -13
- data/lib/puppet/pops/types/type_parser.rb +22 -13
- data/lib/puppet/pops/types/types.rb +23 -4
- data/lib/puppet/pops/types/types_meta.rb +13 -2
- data/lib/puppet/pops/validation.rb +25 -2
- data/lib/puppet/pops/validation/checker4_0.rb +63 -31
- data/lib/puppet/provider/group/windows_adsi.rb +8 -4
- data/lib/puppet/provider/mount/parsed.rb +145 -2
- data/lib/puppet/provider/package/apt.rb +1 -1
- data/lib/puppet/provider/package/pip.rb +11 -2
- data/lib/puppet/provider/package/pkgng.rb +134 -0
- data/lib/puppet/provider/package/portage.rb +1 -1
- data/lib/puppet/provider/package/ports.rb +0 -3
- data/lib/puppet/provider/package/windows/exe_package.rb +0 -1
- data/lib/puppet/provider/package/windows/msi_package.rb +0 -1
- data/lib/puppet/provider/package/zypper.rb +50 -15
- data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +32 -7
- data/lib/puppet/provider/service/debian.rb +1 -1
- data/lib/puppet/provider/service/init.rb +7 -0
- data/lib/puppet/provider/user/openbsd.rb +1 -0
- data/lib/puppet/provider/user/windows_adsi.rb +45 -2
- data/lib/puppet/reference/indirection.rb +1 -1
- data/lib/puppet/resource.rb +1 -1
- data/lib/puppet/resource/catalog.rb +0 -4
- data/lib/puppet/settings.rb +19 -0
- data/lib/puppet/type/file.rb +1 -0
- data/lib/puppet/type/file/ensure.rb +1 -1
- data/lib/puppet/type/mount.rb +9 -1
- data/lib/puppet/type/scheduled_task.rb +13 -0
- data/lib/puppet/type/tidy.rb +3 -1
- data/lib/puppet/type/user.rb +32 -0
- data/lib/puppet/type/yumrepo.rb +5 -5
- data/lib/puppet/util/log.rb +50 -8
- data/lib/puppet/util/log/destinations.rb +23 -2
- data/lib/puppet/util/logging.rb +37 -1
- data/lib/puppet/util/run_mode.rb +1 -14
- data/lib/puppet/util/windows/adsi.rb +130 -58
- data/lib/puppet/version.rb +1 -1
- data/man/man5/puppet.conf.5 +48 -6
- data/man/man8/extlookup2hiera.8 +1 -1
- data/man/man8/puppet-agent.8 +4 -1
- data/man/man8/puppet-apply.8 +4 -1
- data/man/man8/puppet-ca.8 +1 -1
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-cert.8 +1 -1
- data/man/man8/puppet-certificate.8 +1 -1
- data/man/man8/puppet-certificate_request.8 +1 -1
- data/man/man8/puppet-certificate_revocation_list.8 +1 -1
- data/man/man8/puppet-config.8 +1 -1
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +6 -3
- data/man/man8/puppet-doc.8 +1 -1
- data/man/man8/puppet-epp.8 +1 -1
- data/man/man8/puppet-facts.8 +1 -1
- data/man/man8/puppet-file.8 +1 -1
- data/man/man8/puppet-filebucket.8 +1 -1
- data/man/man8/puppet-help.8 +1 -1
- data/man/man8/puppet-inspect.8 +1 -1
- data/man/man8/puppet-key.8 +1 -1
- data/man/man8/puppet-man.8 +1 -1
- data/man/man8/puppet-master.8 +4 -1
- data/man/man8/puppet-module.8 +1 -1
- data/man/man8/puppet-node.8 +1 -1
- data/man/man8/puppet-parser.8 +1 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-report.8 +1 -1
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-resource_type.8 +1 -1
- data/man/man8/puppet-status.8 +1 -1
- data/man/man8/puppet.8 +1 -1
- data/spec/fixtures/unit/data_providers/environments/production/lib/puppet/functions/environment/data.rb +3 -1
- data/spec/fixtures/unit/data_providers/environments/production/modules/xyz/functions/data.pp +6 -0
- data/spec/fixtures/unit/data_providers/environments/production/modules/xyz/lib/puppet/bindings/xyz/default.rb +9 -0
- data/spec/fixtures/unit/data_providers/environments/production/modules/xyz/manifests/init.pp +9 -0
- data/spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/functions/puppetcalled.pp +3 -0
- data/spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/functions/puppetcaller.pp +3 -0
- data/spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/functions/puppetcaller4.pp +3 -0
- data/spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/callingpuppet.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/module_no_lib/modules/modulea/functions/hello.pp +3 -0
- data/spec/fixtures/unit/pops/loaders/loaders/module_no_lib/modules/modulea/manifests/init.pp +3 -0
- data/spec/fixtures/unit/pops/loaders/loaders/module_no_lib/modules/modulea/metadata.json +10 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/functions/hello.pp +3 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/functions/subspace/hello.pp +3 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/metadata.json +1 -10
- data/spec/fixtures/unit/provider/mount/parsed/aix.filesystems +93 -85
- data/spec/fixtures/unit/provider/mount/parsed/aix.mount +11 -7
- data/spec/fixtures/unit/provider/package/pkgng/pkg.info +8 -0
- data/spec/fixtures/unit/provider/package/pkgng/pkg.query +1 -0
- data/spec/fixtures/unit/provider/package/pkgng/pkg.query_absent +1 -0
- data/spec/fixtures/unit/provider/package/pkgng/pkg.version +3 -0
- data/spec/fixtures/unit/provider/package/zypper/zypper-list-updates-empty.out +3 -0
- data/spec/integration/application/apply_spec.rb +49 -0
- data/spec/integration/faces/plugin_spec.rb +0 -4
- data/spec/integration/indirector/facts/facter_spec.rb +59 -0
- data/spec/integration/parser/compiler_spec.rb +850 -0
- data/spec/integration/parser/resource_expressions_spec.rb +3 -0
- data/spec/integration/parser/scope_spec.rb +26 -5
- data/spec/integration/transaction_spec.rb +1 -1
- data/spec/integration/type/file_spec.rb +318 -41
- data/spec/integration/util/windows/security_spec.rb +14 -5
- data/spec/lib/matchers/resource.rb +22 -1
- data/spec/lib/puppet_spec/matchers.rb +6 -4
- data/spec/unit/application/master_spec.rb +33 -7
- data/spec/unit/data_providers/function_data_provider_spec.rb +10 -1
- data/spec/unit/file_serving/metadata_spec.rb +1 -1
- data/spec/unit/file_serving/terminus_helper_spec.rb +2 -3
- data/spec/unit/file_system_spec.rb +38 -0
- data/spec/unit/functions/defined_spec.rb +289 -0
- data/spec/unit/functions/hiera_spec.rb +8 -6
- data/spec/unit/functions/regsubst_spec.rb +4 -0
- data/spec/unit/functions/split_spec.rb +8 -0
- data/spec/unit/functions4_spec.rb +97 -2
- data/spec/unit/indirector/facts/facter_spec.rb +7 -0
- data/spec/unit/node_spec.rb +6 -0
- data/spec/unit/parser/functions/file_spec.rb +7 -1
- data/spec/unit/parser/functions/template_spec.rb +1 -1
- data/spec/unit/parser/scope_spec.rb +2 -2
- data/spec/unit/parser/templatewrapper_spec.rb +1 -1
- data/spec/unit/pops/evaluator/access_ops_spec.rb +19 -0
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +84 -18
- data/spec/unit/pops/evaluator/variables_spec.rb +1 -1
- data/spec/unit/pops/issues_spec.rb +16 -16
- data/spec/unit/pops/loaders/loaders_spec.rb +106 -48
- data/spec/unit/pops/migration_spec.rb +53 -0
- data/spec/unit/pops/parser/lexer2_spec.rb +142 -1
- data/spec/unit/pops/parser/parse_heredoc_spec.rb +26 -0
- data/spec/unit/pops/types/type_calculator_spec.rb +205 -12
- data/spec/unit/pops/validation_spec.rb +66 -0
- data/spec/unit/pops/validator/validator_spec.rb +1 -1
- data/spec/unit/provider/group/windows_adsi_spec.rb +57 -9
- data/spec/unit/provider/mount/parsed_spec.rb +31 -5
- data/spec/unit/provider/package/apt_spec.rb +5 -0
- data/spec/unit/provider/package/pip_spec.rb +9 -0
- data/spec/unit/provider/package/pkgng_spec.rb +172 -0
- data/spec/unit/provider/package/windows/exe_package_spec.rb +0 -1
- data/spec/unit/provider/package/windows/msi_package_spec.rb +0 -1
- data/spec/unit/provider/package/zypper_spec.rb +50 -19
- data/spec/unit/provider/scheduled_task/win32_taskscheduler_spec.rb +312 -70
- data/spec/unit/provider/service/base_spec.rb +38 -27
- data/spec/unit/provider/service/debian_spec.rb +8 -0
- data/spec/unit/provider/service/freebsd_spec.rb +1 -0
- data/spec/unit/provider/service/gentoo_spec.rb +1 -0
- data/spec/unit/provider/service/init_spec.rb +18 -0
- data/spec/unit/provider/service/openbsd_spec.rb +1 -0
- data/spec/unit/provider/service/redhat_spec.rb +1 -0
- data/spec/unit/provider/user/windows_adsi_spec.rb +134 -5
- data/spec/unit/settings_spec.rb +11 -0
- data/spec/unit/util/log_spec.rb +113 -0
- data/spec/unit/util/windows/adsi_spec.rb +135 -41
- data/spec/unit/util/windows/sid_spec.rb +0 -10
- metadata +48 -2
@@ -189,39 +189,50 @@ describe Puppet::Util::Windows::ADSI, :if => Puppet.features.microsoft_windows?
|
|
189
189
|
end
|
190
190
|
|
191
191
|
describe "when given a set of groups to which to add the user" do
|
192
|
+
let(:existing_groups) { ['group2','group3'] }
|
193
|
+
let(:group_sids) { existing_groups.each_with_index.map{|n,i| stub(:Name => n, :objectSID => [i])} }
|
194
|
+
|
192
195
|
let(:groups_to_set) { 'group1,group2' }
|
196
|
+
let(:desired_sids) { groups_to_set.split(',').each_with_index.map{|n,i| stub(:Name => n, :objectSID => [i-1])} }
|
193
197
|
|
194
198
|
before(:each) do
|
195
|
-
|
196
|
-
user.expects(:groups).returns ['group2', 'group3']
|
199
|
+
user.expects(:group_sids).returns(group_sids.map {|s| s.objectSID})
|
197
200
|
end
|
198
201
|
|
199
202
|
describe "if membership is specified as inclusive" do
|
200
203
|
it "should add the user to those groups, and remove it from groups not in the list" do
|
201
|
-
|
202
|
-
|
204
|
+
Puppet::Util::Windows::ADSI::User.expects(:name_sid_hash).returns(Hash[ desired_sids.map { |s| [s.objectSID.to_s, s.objectSID] }])
|
205
|
+
user.expects(:add_group_sids).with([-1])
|
206
|
+
user.expects(:remove_group_sids).with([1])
|
203
207
|
|
204
|
-
|
205
|
-
|
208
|
+
user.set_groups(groups_to_set, false)
|
209
|
+
end
|
206
210
|
|
207
|
-
|
208
|
-
Puppet::Util::Windows::ADSI.expects(:
|
209
|
-
|
211
|
+
it "should remove all users from a group if desired is empty" do
|
212
|
+
Puppet::Util::Windows::ADSI::User.expects(:name_sid_hash).returns({})
|
213
|
+
user.expects(:add_group_sids).never
|
214
|
+
user.expects(:remove_group_sids).with([0], [1])
|
210
215
|
|
211
|
-
user.set_groups(
|
216
|
+
user.set_groups('', false)
|
212
217
|
end
|
213
218
|
end
|
214
219
|
|
215
220
|
describe "if membership is specified as minimum" do
|
216
221
|
it "should add the user to the specified groups without affecting its other memberships" do
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
Puppet::Util::Windows::ADSI.expects(:sid_uri).with(sid).returns("WinNT://testcomputername/#{username},user")
|
221
|
-
Puppet::Util::Windows::ADSI.expects(:connect).with('WinNT://./group1,group').returns group1
|
222
|
+
Puppet::Util::Windows::ADSI::User.expects(:name_sid_hash).returns(Hash[ desired_sids.map { |s| [s.objectSID.to_s, s.objectSID] }])
|
223
|
+
user.expects(:add_group_sids).with([-1])
|
224
|
+
user.expects(:remove_group_sids).never
|
222
225
|
|
223
226
|
user.set_groups(groups_to_set, true)
|
224
227
|
end
|
228
|
+
|
229
|
+
it "should do nothing if desired is empty" do
|
230
|
+
Puppet::Util::Windows::ADSI::User.expects(:name_sid_hash).returns({})
|
231
|
+
user.expects(:remove_group_sids).never
|
232
|
+
user.expects(:add_group_sids).never
|
233
|
+
|
234
|
+
user.set_groups('', true)
|
235
|
+
end
|
225
236
|
end
|
226
237
|
end
|
227
238
|
end
|
@@ -270,42 +281,125 @@ describe Puppet::Util::Windows::ADSI, :if => Puppet.features.microsoft_windows?
|
|
270
281
|
expect(group.members).to match(names)
|
271
282
|
end
|
272
283
|
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
284
|
+
context "calling .set_members" do
|
285
|
+
it "should set the members of a group to only desired_members when inclusive" do
|
286
|
+
names = ['DOMAIN\user1', 'user2']
|
287
|
+
sids = [
|
288
|
+
stub(:account => 'user1', :domain => 'DOMAIN'),
|
289
|
+
stub(:account => 'user2', :domain => 'testcomputername'),
|
290
|
+
stub(:account => 'user3', :domain => 'DOMAIN2'),
|
291
|
+
]
|
280
292
|
|
281
|
-
|
282
|
-
|
283
|
-
|
293
|
+
# use stubbed objectSid on member to return stubbed SID
|
294
|
+
Puppet::Util::Windows::SID.expects(:octet_string_to_sid_object).with([0]).returns(sids[0])
|
295
|
+
Puppet::Util::Windows::SID.expects(:octet_string_to_sid_object).with([1]).returns(sids[1])
|
284
296
|
|
285
|
-
|
286
|
-
|
297
|
+
Puppet::Util::Windows::SID.expects(:name_to_sid_object).with('user2').returns(sids[1])
|
298
|
+
Puppet::Util::Windows::SID.expects(:name_to_sid_object).with('DOMAIN2\user3').returns(sids[2])
|
287
299
|
|
288
|
-
|
289
|
-
|
300
|
+
Puppet::Util::Windows::ADSI.expects(:sid_uri).with(sids[0]).returns("WinNT://DOMAIN/user1,user")
|
301
|
+
Puppet::Util::Windows::ADSI.expects(:sid_uri).with(sids[2]).returns("WinNT://DOMAIN2/user3,user")
|
290
302
|
|
291
|
-
|
292
|
-
|
303
|
+
members = names.each_with_index.map{|n,i| stub(:Name => n, :objectSID => [i])}
|
304
|
+
adsi_group.expects(:Members).returns members
|
293
305
|
|
294
|
-
|
295
|
-
|
306
|
+
adsi_group.expects(:Remove).with('WinNT://DOMAIN/user1,user')
|
307
|
+
adsi_group.expects(:Add).with('WinNT://DOMAIN2/user3,user')
|
296
308
|
|
297
|
-
|
298
|
-
|
309
|
+
group.set_members(['user2', 'DOMAIN2\user3'])
|
310
|
+
end
|
299
311
|
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
312
|
+
it "should add the desired_members to an existing group when not inclusive" do
|
313
|
+
names = ['DOMAIN\user1', 'user2']
|
314
|
+
sids = [
|
315
|
+
stub(:account => 'user1', :domain => 'DOMAIN'),
|
316
|
+
stub(:account => 'user2', :domain => 'testcomputername'),
|
317
|
+
stub(:account => 'user3', :domain => 'DOMAIN2'),
|
318
|
+
]
|
319
|
+
|
320
|
+
# use stubbed objectSid on member to return stubbed SID
|
321
|
+
Puppet::Util::Windows::SID.expects(:octet_string_to_sid_object).with([0]).returns(sids[0])
|
322
|
+
Puppet::Util::Windows::SID.expects(:octet_string_to_sid_object).with([1]).returns(sids[1])
|
323
|
+
|
324
|
+
Puppet::Util::Windows::SID.expects(:name_to_sid_object).with('user2').returns(sids[1])
|
325
|
+
Puppet::Util::Windows::SID.expects(:name_to_sid_object).with('DOMAIN2\user3').returns(sids[2])
|
326
|
+
|
327
|
+
Puppet::Util::Windows::ADSI.expects(:sid_uri).with(sids[2]).returns("WinNT://DOMAIN2/user3,user")
|
328
|
+
|
329
|
+
members = names.each_with_index.map{|n,i| stub(:Name => n, :objectSID => [i])}
|
330
|
+
adsi_group.expects(:Members).returns members
|
331
|
+
|
332
|
+
adsi_group.expects(:Remove).with('WinNT://DOMAIN/user1,user').never
|
333
|
+
|
334
|
+
adsi_group.expects(:Add).with('WinNT://DOMAIN2/user3,user')
|
335
|
+
|
336
|
+
group.set_members(['user2', 'DOMAIN2\user3'],false)
|
337
|
+
end
|
338
|
+
|
339
|
+
it "should return immediately when desired_members is nil" do
|
340
|
+
adsi_group.expects(:Members).never
|
341
|
+
|
342
|
+
adsi_group.expects(:Remove).never
|
343
|
+
adsi_group.expects(:Add).never
|
344
|
+
|
345
|
+
group.set_members(nil)
|
346
|
+
end
|
347
|
+
|
348
|
+
it "should remove all members when desired_members is empty and inclusive" do
|
349
|
+
names = ['DOMAIN\user1', 'user2']
|
350
|
+
sids = [
|
351
|
+
stub(:account => 'user1', :domain => 'DOMAIN'),
|
352
|
+
stub(:account => 'user2', :domain => 'testcomputername')
|
353
|
+
]
|
354
|
+
|
355
|
+
# use stubbed objectSid on member to return stubbed SID
|
356
|
+
Puppet::Util::Windows::SID.expects(:octet_string_to_sid_object).with([0]).returns(sids[0])
|
357
|
+
Puppet::Util::Windows::SID.expects(:octet_string_to_sid_object).with([1]).returns(sids[1])
|
358
|
+
|
359
|
+
Puppet::Util::Windows::ADSI.expects(:sid_uri).with(sids[0]).returns("WinNT://DOMAIN/user1,user")
|
360
|
+
Puppet::Util::Windows::ADSI.expects(:sid_uri).with(sids[1]).returns("WinNT://testcomputername/user2,user")
|
361
|
+
|
362
|
+
members = names.each_with_index.map{|n,i| stub(:Name => n, :objectSID => [i])}
|
363
|
+
adsi_group.expects(:Members).returns members
|
364
|
+
|
365
|
+
adsi_group.expects(:Remove).with('WinNT://DOMAIN/user1,user')
|
366
|
+
adsi_group.expects(:Remove).with('WinNT://testcomputername/user2,user')
|
367
|
+
|
368
|
+
group.set_members([])
|
369
|
+
end
|
370
|
+
|
371
|
+
it "should do nothing when desired_members is empty and not inclusive" do
|
372
|
+
names = ['DOMAIN\user1', 'user2']
|
373
|
+
sids = [
|
374
|
+
stub(:account => 'user1', :domain => 'DOMAIN'),
|
375
|
+
stub(:account => 'user2', :domain => 'testcomputername')
|
376
|
+
]
|
377
|
+
# use stubbed objectSid on member to return stubbed SID
|
378
|
+
Puppet::Util::Windows::SID.expects(:octet_string_to_sid_object).with([0]).returns(sids[0])
|
379
|
+
Puppet::Util::Windows::SID.expects(:octet_string_to_sid_object).with([1]).returns(sids[1])
|
380
|
+
|
381
|
+
members = names.each_with_index.map{|n,i| stub(:Name => n, :objectSID => [i])}
|
382
|
+
adsi_group.expects(:Members).returns members
|
383
|
+
|
384
|
+
adsi_group.expects(:Remove).never
|
385
|
+
adsi_group.expects(:Add).never
|
386
|
+
|
387
|
+
group.set_members([],false)
|
388
|
+
end
|
389
|
+
|
390
|
+
it "should raise an error when a username does not resolve to a SID" do
|
391
|
+
expect {
|
392
|
+
adsi_group.expects(:Members).returns []
|
393
|
+
group.set_members(['foobar'])
|
394
|
+
}.to raise_error(Puppet::Error, /Could not resolve name: foobar/)
|
395
|
+
end
|
305
396
|
end
|
306
397
|
|
307
398
|
it "should generate the correct URI" do
|
308
399
|
Puppet::Util::Windows::ADSI.stubs(:sid_uri_safe).returns(nil)
|
400
|
+
adsi_group.expects(:objectSID).returns([0])
|
401
|
+
Socket.expects(:gethostname).returns('testcomputername')
|
402
|
+
Puppet::Util::Windows::SID.expects(:octet_string_to_sid_object).with([0]).returns(stub(:account => groupname,:domain => 'testcomputername'))
|
309
403
|
expect(group.uri).to eq("WinNT://./#{groupname},group")
|
310
404
|
end
|
311
405
|
end
|
@@ -381,7 +475,7 @@ describe Puppet::Util::Windows::ADSI, :if => Puppet.features.microsoft_windows?
|
|
381
475
|
end
|
382
476
|
|
383
477
|
it "should warn on 2003" do
|
384
|
-
connection.expects(:Delete).raises(
|
478
|
+
connection.expects(:Delete).raises(WIN32OLERuntimeError,
|
385
479
|
"Delete (WIN32OLERuntimeError)
|
386
480
|
OLE error code:80041010 in SWbemServicesEx
|
387
481
|
Invalid class
|
@@ -13,16 +13,6 @@ describe "Puppet::Util::Windows::SID", :if => Puppet.features.microsoft_windows?
|
|
13
13
|
let(:unknown_name) { 'chewbacca' }
|
14
14
|
|
15
15
|
context "#octet_string_to_sid_object" do
|
16
|
-
it "should properly convert an array of bytes for the local Administrator SID" do
|
17
|
-
host = '.'
|
18
|
-
username = 'Administrator'
|
19
|
-
admin = WIN32OLE.connect("WinNT://#{host}/#{username},user")
|
20
|
-
converted = subject.octet_string_to_sid_object(admin.objectSID)
|
21
|
-
|
22
|
-
expect(converted).to eq(Win32::Security::SID.new(username, host))
|
23
|
-
expect(converted).to be_an_instance_of Win32::Security::SID
|
24
|
-
end
|
25
|
-
|
26
16
|
it "should properly convert an array of bytes for a well-known SID" do
|
27
17
|
bytes = [1, 1, 0, 0, 0, 0, 0, 5, 18, 0, 0, 0]
|
28
18
|
converted = subject.octet_string_to_sid_object(bytes)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facter
|
@@ -238,6 +238,7 @@ files:
|
|
238
238
|
- lib/puppet/forge/repository.rb
|
239
239
|
- lib/puppet/functions.rb
|
240
240
|
- lib/puppet/functions/assert_type.rb
|
241
|
+
- lib/puppet/functions/defined.rb
|
241
242
|
- lib/puppet/functions/each.rb
|
242
243
|
- lib/puppet/functions/epp.rb
|
243
244
|
- lib/puppet/functions/filter.rb
|
@@ -579,6 +580,7 @@ files:
|
|
579
580
|
- lib/puppet/pops/loader/loader_paths.rb
|
580
581
|
- lib/puppet/pops/loader/module_loaders.rb
|
581
582
|
- lib/puppet/pops/loader/null_loader.rb
|
583
|
+
- lib/puppet/pops/loader/puppet_function_instantiator.rb
|
582
584
|
- lib/puppet/pops/loader/ruby_function_instantiator.rb
|
583
585
|
- lib/puppet/pops/loader/simple_environment_loader.rb
|
584
586
|
- lib/puppet/pops/loader/static_loader.rb
|
@@ -586,6 +588,7 @@ files:
|
|
586
588
|
- lib/puppet/pops/loaders.rb
|
587
589
|
- lib/puppet/pops/lookup.rb
|
588
590
|
- lib/puppet/pops/merge_strategy.rb
|
591
|
+
- lib/puppet/pops/migration/migration_checker.rb
|
589
592
|
- lib/puppet/pops/model/ast_transformer.rb
|
590
593
|
- lib/puppet/pops/model/factory.rb
|
591
594
|
- lib/puppet/pops/model/model.rb
|
@@ -687,6 +690,7 @@ files:
|
|
687
690
|
- lib/puppet/provider/package/pkg.rb
|
688
691
|
- lib/puppet/provider/package/pkgdmg.rb
|
689
692
|
- lib/puppet/provider/package/pkgin.rb
|
693
|
+
- lib/puppet/provider/package/pkgng.rb
|
690
694
|
- lib/puppet/provider/package/pkgutil.rb
|
691
695
|
- lib/puppet/provider/package/portage.rb
|
692
696
|
- lib/puppet/provider/package/ports.rb
|
@@ -1452,6 +1456,9 @@ files:
|
|
1452
1456
|
- spec/fixtures/unit/data_providers/environments/production/modules/abc/lib/puppet/bindings/abc/default.rb
|
1453
1457
|
- spec/fixtures/unit/data_providers/environments/production/modules/abc/lib/puppet/functions/abc/data.rb
|
1454
1458
|
- spec/fixtures/unit/data_providers/environments/production/modules/abc/manifests/init.pp
|
1459
|
+
- spec/fixtures/unit/data_providers/environments/production/modules/xyz/functions/data.pp
|
1460
|
+
- spec/fixtures/unit/data_providers/environments/production/modules/xyz/lib/puppet/bindings/xyz/default.rb
|
1461
|
+
- spec/fixtures/unit/data_providers/environments/production/modules/xyz/manifests/init.pp
|
1455
1462
|
- spec/fixtures/unit/data_providers/environments/sample/environment.conf
|
1456
1463
|
- spec/fixtures/unit/data_providers/environments/sample/manifests/site.pp
|
1457
1464
|
- spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet/bindings/dataprovider/default.rb
|
@@ -1534,9 +1541,18 @@ files:
|
|
1534
1541
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/callee.rb
|
1535
1542
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/callee_ws.rb
|
1536
1543
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/metadata.json
|
1544
|
+
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/functions/puppetcalled.pp
|
1545
|
+
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/functions/puppetcaller.pp
|
1546
|
+
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/functions/puppetcaller4.pp
|
1537
1547
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/caller.rb
|
1538
1548
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/caller_ws.rb
|
1549
|
+
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/callingpuppet.rb
|
1539
1550
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/metadata.json
|
1551
|
+
- spec/fixtures/unit/pops/loaders/loaders/module_no_lib/modules/modulea/functions/hello.pp
|
1552
|
+
- spec/fixtures/unit/pops/loaders/loaders/module_no_lib/modules/modulea/manifests/init.pp
|
1553
|
+
- spec/fixtures/unit/pops/loaders/loaders/module_no_lib/modules/modulea/metadata.json
|
1554
|
+
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/functions/hello.pp
|
1555
|
+
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/functions/subspace/hello.pp
|
1540
1556
|
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/modulea/rb_func_a.rb
|
1541
1557
|
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/rb_func_a.rb
|
1542
1558
|
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/manifests/init.pp
|
@@ -1628,11 +1644,16 @@ files:
|
|
1628
1644
|
- spec/fixtures/unit/provider/package/pkg/incomplete
|
1629
1645
|
- spec/fixtures/unit/provider/package/pkg/solaris11
|
1630
1646
|
- spec/fixtures/unit/provider/package/pkg/unknown_status
|
1647
|
+
- spec/fixtures/unit/provider/package/pkgng/pkg.info
|
1648
|
+
- spec/fixtures/unit/provider/package/pkgng/pkg.query
|
1649
|
+
- spec/fixtures/unit/provider/package/pkgng/pkg.query_absent
|
1650
|
+
- spec/fixtures/unit/provider/package/pkgng/pkg.version
|
1631
1651
|
- spec/fixtures/unit/provider/package/sun/dummy.server
|
1632
1652
|
- spec/fixtures/unit/provider/package/sun/simple
|
1633
1653
|
- spec/fixtures/unit/provider/package/yum/yum-check-update-multiline.txt
|
1634
1654
|
- spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt
|
1635
1655
|
- spec/fixtures/unit/provider/package/zypper/zypper-list-updates-SLES11sp1.out
|
1656
|
+
- spec/fixtures/unit/provider/package/zypper/zypper-list-updates-empty.out
|
1636
1657
|
- spec/fixtures/unit/provider/parsedfile/simple.txt
|
1637
1658
|
- spec/fixtures/unit/provider/service/gentoo/rc_update_show
|
1638
1659
|
- spec/fixtures/unit/provider/service/openbsd/rcctl_getall
|
@@ -1866,6 +1887,7 @@ files:
|
|
1866
1887
|
- spec/unit/forge/repository_spec.rb
|
1867
1888
|
- spec/unit/forge_spec.rb
|
1868
1889
|
- spec/unit/functions/assert_type_spec.rb
|
1890
|
+
- spec/unit/functions/defined_spec.rb
|
1869
1891
|
- spec/unit/functions/each_spec.rb
|
1870
1892
|
- spec/unit/functions/epp_spec.rb
|
1871
1893
|
- spec/unit/functions/filter_spec.rb
|
@@ -2103,6 +2125,7 @@ files:
|
|
2103
2125
|
- spec/unit/pops/loaders/loaders_spec.rb
|
2104
2126
|
- spec/unit/pops/loaders/module_loaders_spec.rb
|
2105
2127
|
- spec/unit/pops/loaders/static_loader_spec.rb
|
2128
|
+
- spec/unit/pops/migration_spec.rb
|
2106
2129
|
- spec/unit/pops/model/model_spec.rb
|
2107
2130
|
- spec/unit/pops/parser/epp_parser_spec.rb
|
2108
2131
|
- spec/unit/pops/parser/evaluating_parser_spec.rb
|
@@ -2123,6 +2146,7 @@ files:
|
|
2123
2146
|
- spec/unit/pops/types/type_factory_spec.rb
|
2124
2147
|
- spec/unit/pops/types/type_parser_spec.rb
|
2125
2148
|
- spec/unit/pops/utils_spec.rb
|
2149
|
+
- spec/unit/pops/validation_spec.rb
|
2126
2150
|
- spec/unit/pops/validator/validator_spec.rb
|
2127
2151
|
- spec/unit/pops/visitor_spec.rb
|
2128
2152
|
- spec/unit/property/boolean_spec.rb
|
@@ -2177,6 +2201,7 @@ files:
|
|
2177
2201
|
- spec/unit/provider/package/pkg_spec.rb
|
2178
2202
|
- spec/unit/provider/package/pkgdmg_spec.rb
|
2179
2203
|
- spec/unit/provider/package/pkgin_spec.rb
|
2204
|
+
- spec/unit/provider/package/pkgng_spec.rb
|
2180
2205
|
- spec/unit/provider/package/pkgutil_spec.rb
|
2181
2206
|
- spec/unit/provider/package/portage_spec.rb
|
2182
2207
|
- spec/unit/provider/package/puppet_gem_spec.rb
|
@@ -2488,6 +2513,9 @@ test_files:
|
|
2488
2513
|
- spec/fixtures/unit/data_providers/environments/production/modules/abc/lib/puppet/bindings/abc/default.rb
|
2489
2514
|
- spec/fixtures/unit/data_providers/environments/production/modules/abc/lib/puppet/functions/abc/data.rb
|
2490
2515
|
- spec/fixtures/unit/data_providers/environments/production/modules/abc/manifests/init.pp
|
2516
|
+
- spec/fixtures/unit/data_providers/environments/production/modules/xyz/functions/data.pp
|
2517
|
+
- spec/fixtures/unit/data_providers/environments/production/modules/xyz/lib/puppet/bindings/xyz/default.rb
|
2518
|
+
- spec/fixtures/unit/data_providers/environments/production/modules/xyz/manifests/init.pp
|
2491
2519
|
- spec/fixtures/unit/data_providers/environments/sample/environment.conf
|
2492
2520
|
- spec/fixtures/unit/data_providers/environments/sample/manifests/site.pp
|
2493
2521
|
- spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet/bindings/dataprovider/default.rb
|
@@ -2570,9 +2598,18 @@ test_files:
|
|
2570
2598
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/callee.rb
|
2571
2599
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/callee_ws.rb
|
2572
2600
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/metadata.json
|
2601
|
+
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/functions/puppetcalled.pp
|
2602
|
+
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/functions/puppetcaller.pp
|
2603
|
+
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/functions/puppetcaller4.pp
|
2573
2604
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/caller.rb
|
2574
2605
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/caller_ws.rb
|
2606
|
+
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/callingpuppet.rb
|
2575
2607
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/metadata.json
|
2608
|
+
- spec/fixtures/unit/pops/loaders/loaders/module_no_lib/modules/modulea/functions/hello.pp
|
2609
|
+
- spec/fixtures/unit/pops/loaders/loaders/module_no_lib/modules/modulea/manifests/init.pp
|
2610
|
+
- spec/fixtures/unit/pops/loaders/loaders/module_no_lib/modules/modulea/metadata.json
|
2611
|
+
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/functions/hello.pp
|
2612
|
+
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/functions/subspace/hello.pp
|
2576
2613
|
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/modulea/rb_func_a.rb
|
2577
2614
|
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/rb_func_a.rb
|
2578
2615
|
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/manifests/init.pp
|
@@ -2664,11 +2701,16 @@ test_files:
|
|
2664
2701
|
- spec/fixtures/unit/provider/package/pkg/incomplete
|
2665
2702
|
- spec/fixtures/unit/provider/package/pkg/solaris11
|
2666
2703
|
- spec/fixtures/unit/provider/package/pkg/unknown_status
|
2704
|
+
- spec/fixtures/unit/provider/package/pkgng/pkg.info
|
2705
|
+
- spec/fixtures/unit/provider/package/pkgng/pkg.query
|
2706
|
+
- spec/fixtures/unit/provider/package/pkgng/pkg.query_absent
|
2707
|
+
- spec/fixtures/unit/provider/package/pkgng/pkg.version
|
2667
2708
|
- spec/fixtures/unit/provider/package/sun/dummy.server
|
2668
2709
|
- spec/fixtures/unit/provider/package/sun/simple
|
2669
2710
|
- spec/fixtures/unit/provider/package/yum/yum-check-update-multiline.txt
|
2670
2711
|
- spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt
|
2671
2712
|
- spec/fixtures/unit/provider/package/zypper/zypper-list-updates-SLES11sp1.out
|
2713
|
+
- spec/fixtures/unit/provider/package/zypper/zypper-list-updates-empty.out
|
2672
2714
|
- spec/fixtures/unit/provider/parsedfile/simple.txt
|
2673
2715
|
- spec/fixtures/unit/provider/service/gentoo/rc_update_show
|
2674
2716
|
- spec/fixtures/unit/provider/service/openbsd/rcctl_getall
|
@@ -2902,6 +2944,7 @@ test_files:
|
|
2902
2944
|
- spec/unit/forge/repository_spec.rb
|
2903
2945
|
- spec/unit/forge_spec.rb
|
2904
2946
|
- spec/unit/functions/assert_type_spec.rb
|
2947
|
+
- spec/unit/functions/defined_spec.rb
|
2905
2948
|
- spec/unit/functions/each_spec.rb
|
2906
2949
|
- spec/unit/functions/epp_spec.rb
|
2907
2950
|
- spec/unit/functions/filter_spec.rb
|
@@ -3139,6 +3182,7 @@ test_files:
|
|
3139
3182
|
- spec/unit/pops/loaders/loaders_spec.rb
|
3140
3183
|
- spec/unit/pops/loaders/module_loaders_spec.rb
|
3141
3184
|
- spec/unit/pops/loaders/static_loader_spec.rb
|
3185
|
+
- spec/unit/pops/migration_spec.rb
|
3142
3186
|
- spec/unit/pops/model/model_spec.rb
|
3143
3187
|
- spec/unit/pops/parser/epp_parser_spec.rb
|
3144
3188
|
- spec/unit/pops/parser/evaluating_parser_spec.rb
|
@@ -3159,6 +3203,7 @@ test_files:
|
|
3159
3203
|
- spec/unit/pops/types/type_factory_spec.rb
|
3160
3204
|
- spec/unit/pops/types/type_parser_spec.rb
|
3161
3205
|
- spec/unit/pops/utils_spec.rb
|
3206
|
+
- spec/unit/pops/validation_spec.rb
|
3162
3207
|
- spec/unit/pops/validator/validator_spec.rb
|
3163
3208
|
- spec/unit/pops/visitor_spec.rb
|
3164
3209
|
- spec/unit/property/boolean_spec.rb
|
@@ -3213,6 +3258,7 @@ test_files:
|
|
3213
3258
|
- spec/unit/provider/package/pkg_spec.rb
|
3214
3259
|
- spec/unit/provider/package/pkgdmg_spec.rb
|
3215
3260
|
- spec/unit/provider/package/pkgin_spec.rb
|
3261
|
+
- spec/unit/provider/package/pkgng_spec.rb
|
3216
3262
|
- spec/unit/provider/package/pkgutil_spec.rb
|
3217
3263
|
- spec/unit/provider/package/portage_spec.rb
|
3218
3264
|
- spec/unit/provider/package/puppet_gem_spec.rb
|