puppet 4.0.0-x86-mingw32 → 4.1.0-x86-mingw32
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: x86-mingw32
|
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
|
@@ -336,6 +336,7 @@ files:
|
|
336
336
|
- lib/puppet/forge/repository.rb
|
337
337
|
- lib/puppet/functions.rb
|
338
338
|
- lib/puppet/functions/assert_type.rb
|
339
|
+
- lib/puppet/functions/defined.rb
|
339
340
|
- lib/puppet/functions/each.rb
|
340
341
|
- lib/puppet/functions/epp.rb
|
341
342
|
- lib/puppet/functions/filter.rb
|
@@ -677,6 +678,7 @@ files:
|
|
677
678
|
- lib/puppet/pops/loader/loader_paths.rb
|
678
679
|
- lib/puppet/pops/loader/module_loaders.rb
|
679
680
|
- lib/puppet/pops/loader/null_loader.rb
|
681
|
+
- lib/puppet/pops/loader/puppet_function_instantiator.rb
|
680
682
|
- lib/puppet/pops/loader/ruby_function_instantiator.rb
|
681
683
|
- lib/puppet/pops/loader/simple_environment_loader.rb
|
682
684
|
- lib/puppet/pops/loader/static_loader.rb
|
@@ -684,6 +686,7 @@ files:
|
|
684
686
|
- lib/puppet/pops/loaders.rb
|
685
687
|
- lib/puppet/pops/lookup.rb
|
686
688
|
- lib/puppet/pops/merge_strategy.rb
|
689
|
+
- lib/puppet/pops/migration/migration_checker.rb
|
687
690
|
- lib/puppet/pops/model/ast_transformer.rb
|
688
691
|
- lib/puppet/pops/model/factory.rb
|
689
692
|
- lib/puppet/pops/model/model.rb
|
@@ -785,6 +788,7 @@ files:
|
|
785
788
|
- lib/puppet/provider/package/pkg.rb
|
786
789
|
- lib/puppet/provider/package/pkgdmg.rb
|
787
790
|
- lib/puppet/provider/package/pkgin.rb
|
791
|
+
- lib/puppet/provider/package/pkgng.rb
|
788
792
|
- lib/puppet/provider/package/pkgutil.rb
|
789
793
|
- lib/puppet/provider/package/portage.rb
|
790
794
|
- lib/puppet/provider/package/ports.rb
|
@@ -1550,6 +1554,9 @@ files:
|
|
1550
1554
|
- spec/fixtures/unit/data_providers/environments/production/modules/abc/lib/puppet/bindings/abc/default.rb
|
1551
1555
|
- spec/fixtures/unit/data_providers/environments/production/modules/abc/lib/puppet/functions/abc/data.rb
|
1552
1556
|
- spec/fixtures/unit/data_providers/environments/production/modules/abc/manifests/init.pp
|
1557
|
+
- spec/fixtures/unit/data_providers/environments/production/modules/xyz/functions/data.pp
|
1558
|
+
- spec/fixtures/unit/data_providers/environments/production/modules/xyz/lib/puppet/bindings/xyz/default.rb
|
1559
|
+
- spec/fixtures/unit/data_providers/environments/production/modules/xyz/manifests/init.pp
|
1553
1560
|
- spec/fixtures/unit/data_providers/environments/sample/environment.conf
|
1554
1561
|
- spec/fixtures/unit/data_providers/environments/sample/manifests/site.pp
|
1555
1562
|
- spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet/bindings/dataprovider/default.rb
|
@@ -1632,9 +1639,18 @@ files:
|
|
1632
1639
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/callee.rb
|
1633
1640
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/callee_ws.rb
|
1634
1641
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/metadata.json
|
1642
|
+
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/functions/puppetcalled.pp
|
1643
|
+
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/functions/puppetcaller.pp
|
1644
|
+
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/functions/puppetcaller4.pp
|
1635
1645
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/caller.rb
|
1636
1646
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/caller_ws.rb
|
1647
|
+
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/callingpuppet.rb
|
1637
1648
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/metadata.json
|
1649
|
+
- spec/fixtures/unit/pops/loaders/loaders/module_no_lib/modules/modulea/functions/hello.pp
|
1650
|
+
- spec/fixtures/unit/pops/loaders/loaders/module_no_lib/modules/modulea/manifests/init.pp
|
1651
|
+
- spec/fixtures/unit/pops/loaders/loaders/module_no_lib/modules/modulea/metadata.json
|
1652
|
+
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/functions/hello.pp
|
1653
|
+
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/functions/subspace/hello.pp
|
1638
1654
|
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/modulea/rb_func_a.rb
|
1639
1655
|
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/rb_func_a.rb
|
1640
1656
|
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/manifests/init.pp
|
@@ -1726,11 +1742,16 @@ files:
|
|
1726
1742
|
- spec/fixtures/unit/provider/package/pkg/incomplete
|
1727
1743
|
- spec/fixtures/unit/provider/package/pkg/solaris11
|
1728
1744
|
- spec/fixtures/unit/provider/package/pkg/unknown_status
|
1745
|
+
- spec/fixtures/unit/provider/package/pkgng/pkg.info
|
1746
|
+
- spec/fixtures/unit/provider/package/pkgng/pkg.query
|
1747
|
+
- spec/fixtures/unit/provider/package/pkgng/pkg.query_absent
|
1748
|
+
- spec/fixtures/unit/provider/package/pkgng/pkg.version
|
1729
1749
|
- spec/fixtures/unit/provider/package/sun/dummy.server
|
1730
1750
|
- spec/fixtures/unit/provider/package/sun/simple
|
1731
1751
|
- spec/fixtures/unit/provider/package/yum/yum-check-update-multiline.txt
|
1732
1752
|
- spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt
|
1733
1753
|
- spec/fixtures/unit/provider/package/zypper/zypper-list-updates-SLES11sp1.out
|
1754
|
+
- spec/fixtures/unit/provider/package/zypper/zypper-list-updates-empty.out
|
1734
1755
|
- spec/fixtures/unit/provider/parsedfile/simple.txt
|
1735
1756
|
- spec/fixtures/unit/provider/service/gentoo/rc_update_show
|
1736
1757
|
- spec/fixtures/unit/provider/service/openbsd/rcctl_getall
|
@@ -1964,6 +1985,7 @@ files:
|
|
1964
1985
|
- spec/unit/forge/repository_spec.rb
|
1965
1986
|
- spec/unit/forge_spec.rb
|
1966
1987
|
- spec/unit/functions/assert_type_spec.rb
|
1988
|
+
- spec/unit/functions/defined_spec.rb
|
1967
1989
|
- spec/unit/functions/each_spec.rb
|
1968
1990
|
- spec/unit/functions/epp_spec.rb
|
1969
1991
|
- spec/unit/functions/filter_spec.rb
|
@@ -2201,6 +2223,7 @@ files:
|
|
2201
2223
|
- spec/unit/pops/loaders/loaders_spec.rb
|
2202
2224
|
- spec/unit/pops/loaders/module_loaders_spec.rb
|
2203
2225
|
- spec/unit/pops/loaders/static_loader_spec.rb
|
2226
|
+
- spec/unit/pops/migration_spec.rb
|
2204
2227
|
- spec/unit/pops/model/model_spec.rb
|
2205
2228
|
- spec/unit/pops/parser/epp_parser_spec.rb
|
2206
2229
|
- spec/unit/pops/parser/evaluating_parser_spec.rb
|
@@ -2221,6 +2244,7 @@ files:
|
|
2221
2244
|
- spec/unit/pops/types/type_factory_spec.rb
|
2222
2245
|
- spec/unit/pops/types/type_parser_spec.rb
|
2223
2246
|
- spec/unit/pops/utils_spec.rb
|
2247
|
+
- spec/unit/pops/validation_spec.rb
|
2224
2248
|
- spec/unit/pops/validator/validator_spec.rb
|
2225
2249
|
- spec/unit/pops/visitor_spec.rb
|
2226
2250
|
- spec/unit/property/boolean_spec.rb
|
@@ -2275,6 +2299,7 @@ files:
|
|
2275
2299
|
- spec/unit/provider/package/pkg_spec.rb
|
2276
2300
|
- spec/unit/provider/package/pkgdmg_spec.rb
|
2277
2301
|
- spec/unit/provider/package/pkgin_spec.rb
|
2302
|
+
- spec/unit/provider/package/pkgng_spec.rb
|
2278
2303
|
- spec/unit/provider/package/pkgutil_spec.rb
|
2279
2304
|
- spec/unit/provider/package/portage_spec.rb
|
2280
2305
|
- spec/unit/provider/package/puppet_gem_spec.rb
|
@@ -2586,6 +2611,9 @@ test_files:
|
|
2586
2611
|
- spec/fixtures/unit/data_providers/environments/production/modules/abc/lib/puppet/bindings/abc/default.rb
|
2587
2612
|
- spec/fixtures/unit/data_providers/environments/production/modules/abc/lib/puppet/functions/abc/data.rb
|
2588
2613
|
- spec/fixtures/unit/data_providers/environments/production/modules/abc/manifests/init.pp
|
2614
|
+
- spec/fixtures/unit/data_providers/environments/production/modules/xyz/functions/data.pp
|
2615
|
+
- spec/fixtures/unit/data_providers/environments/production/modules/xyz/lib/puppet/bindings/xyz/default.rb
|
2616
|
+
- spec/fixtures/unit/data_providers/environments/production/modules/xyz/manifests/init.pp
|
2589
2617
|
- spec/fixtures/unit/data_providers/environments/sample/environment.conf
|
2590
2618
|
- spec/fixtures/unit/data_providers/environments/sample/manifests/site.pp
|
2591
2619
|
- spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet/bindings/dataprovider/default.rb
|
@@ -2668,9 +2696,18 @@ test_files:
|
|
2668
2696
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/callee.rb
|
2669
2697
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/callee_ws.rb
|
2670
2698
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/metadata.json
|
2699
|
+
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/functions/puppetcalled.pp
|
2700
|
+
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/functions/puppetcaller.pp
|
2701
|
+
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/functions/puppetcaller4.pp
|
2671
2702
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/caller.rb
|
2672
2703
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/caller_ws.rb
|
2704
|
+
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/callingpuppet.rb
|
2673
2705
|
- spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/metadata.json
|
2706
|
+
- spec/fixtures/unit/pops/loaders/loaders/module_no_lib/modules/modulea/functions/hello.pp
|
2707
|
+
- spec/fixtures/unit/pops/loaders/loaders/module_no_lib/modules/modulea/manifests/init.pp
|
2708
|
+
- spec/fixtures/unit/pops/loaders/loaders/module_no_lib/modules/modulea/metadata.json
|
2709
|
+
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/functions/hello.pp
|
2710
|
+
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/functions/subspace/hello.pp
|
2674
2711
|
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/modulea/rb_func_a.rb
|
2675
2712
|
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/rb_func_a.rb
|
2676
2713
|
- spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/manifests/init.pp
|
@@ -2762,11 +2799,16 @@ test_files:
|
|
2762
2799
|
- spec/fixtures/unit/provider/package/pkg/incomplete
|
2763
2800
|
- spec/fixtures/unit/provider/package/pkg/solaris11
|
2764
2801
|
- spec/fixtures/unit/provider/package/pkg/unknown_status
|
2802
|
+
- spec/fixtures/unit/provider/package/pkgng/pkg.info
|
2803
|
+
- spec/fixtures/unit/provider/package/pkgng/pkg.query
|
2804
|
+
- spec/fixtures/unit/provider/package/pkgng/pkg.query_absent
|
2805
|
+
- spec/fixtures/unit/provider/package/pkgng/pkg.version
|
2765
2806
|
- spec/fixtures/unit/provider/package/sun/dummy.server
|
2766
2807
|
- spec/fixtures/unit/provider/package/sun/simple
|
2767
2808
|
- spec/fixtures/unit/provider/package/yum/yum-check-update-multiline.txt
|
2768
2809
|
- spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt
|
2769
2810
|
- spec/fixtures/unit/provider/package/zypper/zypper-list-updates-SLES11sp1.out
|
2811
|
+
- spec/fixtures/unit/provider/package/zypper/zypper-list-updates-empty.out
|
2770
2812
|
- spec/fixtures/unit/provider/parsedfile/simple.txt
|
2771
2813
|
- spec/fixtures/unit/provider/service/gentoo/rc_update_show
|
2772
2814
|
- spec/fixtures/unit/provider/service/openbsd/rcctl_getall
|
@@ -3000,6 +3042,7 @@ test_files:
|
|
3000
3042
|
- spec/unit/forge/repository_spec.rb
|
3001
3043
|
- spec/unit/forge_spec.rb
|
3002
3044
|
- spec/unit/functions/assert_type_spec.rb
|
3045
|
+
- spec/unit/functions/defined_spec.rb
|
3003
3046
|
- spec/unit/functions/each_spec.rb
|
3004
3047
|
- spec/unit/functions/epp_spec.rb
|
3005
3048
|
- spec/unit/functions/filter_spec.rb
|
@@ -3237,6 +3280,7 @@ test_files:
|
|
3237
3280
|
- spec/unit/pops/loaders/loaders_spec.rb
|
3238
3281
|
- spec/unit/pops/loaders/module_loaders_spec.rb
|
3239
3282
|
- spec/unit/pops/loaders/static_loader_spec.rb
|
3283
|
+
- spec/unit/pops/migration_spec.rb
|
3240
3284
|
- spec/unit/pops/model/model_spec.rb
|
3241
3285
|
- spec/unit/pops/parser/epp_parser_spec.rb
|
3242
3286
|
- spec/unit/pops/parser/evaluating_parser_spec.rb
|
@@ -3257,6 +3301,7 @@ test_files:
|
|
3257
3301
|
- spec/unit/pops/types/type_factory_spec.rb
|
3258
3302
|
- spec/unit/pops/types/type_parser_spec.rb
|
3259
3303
|
- spec/unit/pops/utils_spec.rb
|
3304
|
+
- spec/unit/pops/validation_spec.rb
|
3260
3305
|
- spec/unit/pops/validator/validator_spec.rb
|
3261
3306
|
- spec/unit/pops/visitor_spec.rb
|
3262
3307
|
- spec/unit/property/boolean_spec.rb
|
@@ -3311,6 +3356,7 @@ test_files:
|
|
3311
3356
|
- spec/unit/provider/package/pkg_spec.rb
|
3312
3357
|
- spec/unit/provider/package/pkgdmg_spec.rb
|
3313
3358
|
- spec/unit/provider/package/pkgin_spec.rb
|
3359
|
+
- spec/unit/provider/package/pkgng_spec.rb
|
3314
3360
|
- spec/unit/provider/package/pkgutil_spec.rb
|
3315
3361
|
- spec/unit/provider/package/portage_spec.rb
|
3316
3362
|
- spec/unit/provider/package/puppet_gem_spec.rb
|