puppet 2.7.19 → 2.7.20.rc1
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.
- data/CONTRIBUTING.md +61 -238
- data/Gemfile +32 -0
- data/Gemfile.lock +44 -0
- data/LICENSE +1 -1
- data/README_DEVELOPER.md +300 -5
- data/Rakefile +41 -37
- data/ext/build_defaults.yaml +20 -0
- data/ext/debian/README.Debian +8 -0
- data/ext/debian/README.source +2 -0
- data/ext/debian/TODO.Debian +1 -0
- data/ext/debian/changelog.erb +1104 -0
- data/ext/debian/compat +1 -0
- data/ext/debian/control +142 -0
- data/ext/debian/copyright +361 -0
- data/ext/debian/docs +1 -0
- data/ext/debian/fileserver.conf +17 -0
- data/ext/debian/puppet-common.dirs +8 -0
- data/ext/debian/puppet-common.install +3 -0
- data/ext/debian/puppet-common.lintian-overrides +7 -0
- data/ext/debian/puppet-common.manpages +2 -0
- data/ext/debian/puppet-common.postinst +35 -0
- data/ext/debian/puppet-common.postrm +32 -0
- data/ext/debian/puppet-el.dirs +1 -0
- data/ext/debian/puppet-el.emacsen-install +25 -0
- data/ext/debian/puppet-el.emacsen-remove +11 -0
- data/ext/debian/puppet-el.emacsen-startup +9 -0
- data/ext/debian/puppet-el.install +1 -0
- data/ext/debian/puppet-testsuite.install +3 -0
- data/ext/debian/puppet-testsuite.lintian-overrides +4 -0
- data/ext/debian/puppet.NEWS +86 -0
- data/ext/debian/puppet.conf +14 -0
- data/ext/debian/puppet.default +7 -0
- data/ext/debian/puppet.dirs +1 -0
- data/ext/debian/puppet.init +118 -0
- data/ext/debian/puppet.install +4 -0
- data/ext/debian/puppet.lintian-overrides +3 -0
- data/ext/debian/puppet.logrotate +11 -0
- data/ext/debian/puppet.manpages +36 -0
- data/ext/debian/puppet.postinst +20 -0
- data/ext/debian/puppet.postrm +20 -0
- data/ext/debian/puppet.preinst +20 -0
- data/ext/debian/puppetmaster-common.install +5 -0
- data/ext/debian/puppetmaster-common.manpages +5 -0
- data/ext/debian/puppetmaster-common.puppetqd.default +27 -0
- data/ext/debian/puppetmaster-common.puppetqd.init +84 -0
- data/ext/debian/puppetmaster-passenger.dirs +4 -0
- data/ext/debian/puppetmaster-passenger.postinst +66 -0
- data/ext/debian/puppetmaster-passenger.postrm +33 -0
- data/ext/debian/puppetmaster.NEWS +13 -0
- data/ext/debian/puppetmaster.README.debian +16 -0
- data/ext/debian/puppetmaster.default +38 -0
- data/ext/debian/puppetmaster.dirs +1 -0
- data/ext/debian/puppetmaster.init +158 -0
- data/ext/debian/puppetmaster.install +1 -0
- data/ext/debian/puppetmaster.lintian-overrides +3 -0
- data/ext/debian/puppetmaster.manpages +1 -0
- data/ext/debian/puppetmaster.postinst +20 -0
- data/ext/debian/puppetmaster.postrm +5 -0
- data/ext/debian/puppetmaster.preinst +22 -0
- data/ext/debian/rules +127 -0
- data/ext/debian/source/format +1 -0
- data/ext/debian/source/options +1 -0
- data/ext/debian/vim-puppet.README.Debian +13 -0
- data/ext/debian/vim-puppet.dirs +3 -0
- data/ext/debian/vim-puppet.yaml +5 -0
- data/ext/debian/watch +2 -0
- data/ext/emacs/puppet-mode.el +1 -0
- data/{conf → ext}/osx/PackageInfo.plist +0 -0
- data/{conf → ext}/osx/createpackage.sh +0 -0
- data/ext/osx/file_mapping.yaml +38 -0
- data/ext/osx/preflight.erb +37 -0
- data/{tasks/rake/templates → ext/osx}/prototype.plist.erb +0 -0
- data/ext/packaging/README-Solaris.md +117 -0
- data/ext/packaging/README.md +255 -0
- data/ext/packaging/spec/spec_helper.rb +12 -0
- data/ext/packaging/spec/tasks/00_utils_spec.rb +66 -0
- data/ext/packaging/tasks/00_utils.rake +382 -0
- data/ext/packaging/tasks/10_setupvars.rake +71 -0
- data/ext/packaging/tasks/20_setupextravars.rake +25 -0
- data/ext/packaging/tasks/apple.rake +201 -0
- data/ext/packaging/tasks/clean.rake +5 -0
- data/ext/packaging/tasks/deb.rake +108 -0
- data/ext/packaging/tasks/doc.rake +20 -0
- data/ext/packaging/tasks/fetch.rake +18 -0
- data/ext/packaging/tasks/gem.rake +68 -0
- data/ext/packaging/tasks/ips.rake +80 -0
- data/ext/packaging/tasks/mock.rake +126 -0
- data/ext/packaging/tasks/pe_deb.rake +9 -0
- data/ext/packaging/tasks/pe_remote.rake +45 -0
- data/ext/packaging/tasks/pe_rpm.rake +21 -0
- data/ext/packaging/tasks/pe_ship.rake +30 -0
- data/ext/packaging/tasks/pe_sign.rake +27 -0
- data/ext/packaging/tasks/pe_sles.rake +96 -0
- data/ext/packaging/tasks/release.rake +73 -0
- data/ext/packaging/tasks/remote_build.rake +78 -0
- data/ext/packaging/tasks/rpm.rake +52 -0
- data/ext/packaging/tasks/ship.rake +78 -0
- data/ext/packaging/tasks/sign.rake +82 -0
- data/ext/packaging/tasks/tag.rake +8 -0
- data/ext/packaging/tasks/tar.rake +68 -0
- data/ext/packaging/tasks/template.rake +13 -0
- data/ext/packaging/tasks/update.rake +16 -0
- data/ext/packaging/tasks/version.rake +21 -0
- data/ext/project_data.yaml +24 -0
- data/{conf/redhat/puppet.spec → ext/redhat/puppet.spec.erb} +18 -10
- data/install.rb +8 -8
- data/lib/puppet.rb +2 -6
- data/lib/puppet/agent/locker.rb +2 -0
- data/lib/puppet/application.rb +1 -1
- data/lib/puppet/application/agent.rb +1 -1
- data/lib/puppet/application/apply.rb +1 -1
- data/lib/puppet/application/cert.rb +5 -6
- data/lib/puppet/application/describe.rb +1 -1
- data/lib/puppet/application/device.rb +1 -1
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/application/filebucket.rb +1 -1
- data/lib/puppet/application/inspect.rb +1 -1
- data/lib/puppet/application/kick.rb +1 -1
- data/lib/puppet/application/master.rb +1 -1
- data/lib/puppet/application/resource.rb +1 -1
- data/lib/puppet/defaults.rb +21 -3
- data/lib/puppet/external/dot.rb +1 -1
- data/lib/puppet/face/help/global.erb +1 -1
- data/lib/puppet/face/module/install.rb +1 -1
- data/lib/puppet/face/module/list.rb +1 -1
- data/lib/puppet/face/module/uninstall.rb +1 -1
- data/lib/puppet/face/node/clean.rb +23 -18
- data/lib/puppet/face/parser.rb +11 -2
- data/lib/puppet/file_collection.rb +16 -27
- data/lib/puppet/file_collection/lookup.rb +6 -16
- data/lib/puppet/file_serving/base.rb +4 -4
- data/lib/puppet/indirector/catalog/static_compiler.rb +3 -4
- data/lib/puppet/indirector/certificate/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/certificate_request/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/certificate_revocation_list/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/face.rb +2 -2
- data/lib/puppet/indirector/key/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/node/exec.rb +13 -1
- data/lib/puppet/indirector/request.rb +4 -0
- data/lib/puppet/metatype/manager.rb +17 -10
- data/lib/puppet/network/authstore.rb +1 -1
- data/lib/puppet/network/rights.rb +1 -2
- data/lib/puppet/node/environment.rb +1 -0
- data/lib/puppet/parameter/value.rb +9 -3
- data/lib/puppet/parser/ast.rb +1 -4
- data/lib/puppet/parser/files.rb +1 -1
- data/lib/puppet/parser/functions.rb +68 -22
- data/lib/puppet/parser/functions/create_resources.rb +2 -3
- data/lib/puppet/parser/functions/shellquote.rb +21 -25
- data/lib/puppet/parser/lexer.rb +40 -6
- data/lib/puppet/parser/relationship.rb +3 -1
- data/lib/puppet/parser/resource.rb +2 -3
- data/lib/puppet/parser/resource/param.rb +3 -5
- data/lib/puppet/parser/scope.rb +7 -4
- data/lib/puppet/property.rb +5 -3
- data/lib/puppet/provider.rb +5 -5
- data/lib/puppet/provider/aixobject.rb +1 -1
- data/lib/puppet/provider/augeas/augeas.rb +1 -1
- data/lib/puppet/provider/exec/windows.rb +1 -1
- data/lib/puppet/provider/file/windows.rb +10 -29
- data/lib/puppet/provider/group/groupadd.rb +2 -3
- data/lib/puppet/provider/group/ldap.rb +1 -1
- data/lib/puppet/provider/group/windows_adsi.rb +1 -1
- data/lib/puppet/provider/ldap.rb +5 -1
- data/lib/puppet/provider/nameservice.rb +3 -3
- data/lib/puppet/provider/nameservice/directoryservice.rb +2 -2
- data/lib/puppet/provider/package/gem.rb +6 -2
- data/lib/puppet/provider/package/portage.rb +4 -2
- data/lib/puppet/provider/parsedfile.rb +1 -1
- data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +2 -2
- data/lib/puppet/provider/service/base.rb +2 -41
- data/lib/puppet/provider/service/daemontools.rb +1 -1
- data/lib/puppet/provider/service/launchd.rb +1 -1
- data/lib/puppet/provider/service/redhat.rb +6 -5
- data/lib/puppet/provider/service/runit.rb +1 -1
- data/lib/puppet/provider/service/service.rb +43 -0
- data/lib/puppet/provider/service/windows.rb +1 -8
- data/lib/puppet/provider/user/user_role_add.rb +2 -1
- data/lib/puppet/provider/user/useradd.rb +8 -3
- data/lib/puppet/provider/user/windows_adsi.rb +12 -1
- data/lib/puppet/provider/zone/solaris.rb +1 -1
- data/lib/puppet/rails/inventory_node.rb +26 -13
- data/lib/puppet/reports.rb +1 -1
- data/lib/puppet/resource.rb +20 -5
- data/lib/puppet/resource/status.rb +1 -1
- data/lib/puppet/ssl/certificate_authority.rb +2 -0
- data/lib/puppet/ssl/host.rb +31 -6
- data/lib/puppet/test/test_helper.rb +3 -1
- data/lib/puppet/transaction/event.rb +1 -1
- data/lib/puppet/transaction/report.rb +2 -2
- data/lib/puppet/type.rb +30 -25
- data/lib/puppet/type/augeas.rb +1 -1
- data/lib/puppet/type/cron.rb +2 -2
- data/lib/puppet/type/exec.rb +6 -6
- data/lib/puppet/type/file.rb +5 -15
- data/lib/puppet/type/file/content.rb +1 -1
- data/lib/puppet/type/file/ensure.rb +1 -1
- data/lib/puppet/type/file/mode.rb +1 -1
- data/lib/puppet/type/file/selcontext.rb +6 -2
- data/lib/puppet/type/file/source.rb +1 -1
- data/lib/puppet/type/mount.rb +1 -1
- data/lib/puppet/type/package.rb +1 -1
- data/lib/puppet/type/schedule.rb +1 -1
- data/lib/puppet/type/scheduled_task.rb +1 -1
- data/lib/puppet/type/tidy.rb +1 -1
- data/lib/puppet/type/whit.rb +16 -9
- data/lib/puppet/util.rb +27 -11
- data/lib/puppet/util/adsi.rb +25 -23
- data/lib/puppet/util/autoload.rb +1 -1
- data/lib/puppet/util/classgen.rb +1 -1
- data/lib/puppet/util/feature.rb +3 -1
- data/lib/puppet/util/fileparsing.rb +9 -9
- data/lib/puppet/util/filetype.rb +55 -40
- data/lib/puppet/util/instance_loader.rb +5 -5
- data/lib/puppet/util/instrumentation.rb +3 -5
- data/lib/puppet/util/log_paths.rb +1 -3
- data/lib/puppet/util/monkey_patches.rb +34 -8
- data/lib/puppet/util/platform.rb +7 -0
- data/lib/puppet/util/posix.rb +3 -3
- data/lib/puppet/util/provider_features.rb +2 -3
- data/lib/puppet/util/rdoc.rb +4 -3
- data/lib/puppet/util/reference.rb +1 -1
- data/lib/puppet/util/selinux.rb +31 -36
- data/lib/puppet/util/tagging.rb +28 -6
- data/lib/puppet/util/windows.rb +1 -0
- data/lib/puppet/util/windows/error.rb +1 -1
- data/lib/puppet/util/windows/process.rb +3 -3
- data/lib/puppet/util/windows/security.rb +9 -46
- data/lib/puppet/util/windows/sid.rb +96 -0
- data/lib/puppet/util/windows/user.rb +65 -2
- data/lib/puppet/util/zaml.rb +109 -59
- data/lib/puppet/version.rb +18 -0
- data/spec/fixtures/unit/util/filetype/aixtab_output +44 -0
- data/spec/fixtures/unit/util/filetype/suntab_output +9 -0
- data/spec/integration/defaults_spec.rb +26 -7
- data/spec/integration/parser/functions_spec.rb +0 -4
- data/spec/integration/util/file_locking_spec.rb +1 -1
- data/spec/integration/util/windows/security_spec.rb +3 -23
- data/spec/lib/puppet_spec/files.rb +3 -3
- data/spec/shared_contexts/platform.rb +8 -0
- data/spec/spec_helper.rb +6 -1
- data/spec/unit/application/queue_spec.rb +2 -1
- data/spec/unit/configurer_spec.rb +1 -1
- data/spec/unit/face/{instrumentation_data.rb → instrumentation_data_spec.rb} +0 -0
- data/spec/unit/face/{instrumentation_listener.rb → instrumentation_listener_spec.rb} +0 -0
- data/spec/unit/face/{instrumentation_probe.rb → instrumentation_probe_spec.rb} +0 -0
- data/spec/unit/indirector/catalog/static_compiler_spec.rb +194 -0
- data/spec/unit/indirector/certificate/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/certificate_request/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/certificate_revocation_list/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/key/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/request_spec.rb +22 -0
- data/spec/unit/network/http/webrick_spec.rb +0 -7
- data/spec/unit/node/environment_spec.rb +8 -8
- data/spec/unit/parser/ast_spec.rb +0 -5
- data/spec/unit/parser/collector_spec.rb +1 -0
- data/spec/unit/parser/files_spec.rb +2 -2
- data/spec/unit/parser/functions/create_resources_spec.rb +3 -4
- data/spec/unit/parser/functions/require_spec.rb +0 -6
- data/spec/unit/parser/functions/shellquote_spec.rb +0 -5
- data/spec/unit/parser/functions/template_spec.rb +6 -1
- data/spec/unit/parser/functions_spec.rb +73 -23
- data/spec/unit/parser/lexer_spec.rb +133 -8
- data/spec/unit/parser/relationship_spec.rb +24 -0
- data/spec/unit/parser/resource_spec.rb +0 -4
- data/spec/unit/parser/scope_spec.rb +2 -2
- data/spec/unit/property_spec.rb +21 -1
- data/spec/unit/provider/exec/posix_spec.rb +7 -6
- data/spec/unit/provider/file/windows_spec.rb +29 -29
- data/spec/unit/provider/group/groupadd_spec.rb +36 -30
- data/spec/unit/provider/group/windows_adsi_spec.rb +2 -2
- data/spec/unit/provider/package/gem_spec.rb +12 -0
- data/spec/unit/provider/scheduled_task/win32_taskscheduler_spec.rb +14 -11
- data/spec/unit/provider/service/redhat_spec.rb +11 -1
- data/spec/unit/provider/service/windows_spec.rb +19 -0
- data/spec/unit/provider/user/ldap_spec.rb +22 -8
- data/spec/unit/provider/user/user_role_add_spec.rb +12 -0
- data/spec/unit/provider/user/useradd_spec.rb +146 -118
- data/spec/unit/provider/user/windows_adsi_spec.rb +24 -2
- data/spec/unit/puppet_spec.rb +10 -0
- data/spec/unit/resource/status_spec.rb +1 -1
- data/spec/unit/resource_spec.rb +73 -0
- data/spec/unit/ssl/certificate_authority_spec.rb +25 -1
- data/spec/unit/ssl/host_spec.rb +73 -27
- data/spec/unit/ssl/key_spec.rb +0 -4
- data/spec/unit/transaction/event_spec.rb +1 -1
- data/spec/unit/type/exec_spec.rb +1 -1
- data/spec/unit/type/file/content_spec.rb +6 -4
- data/spec/unit/type/file/{ctime.rb → ctime_spec.rb} +0 -0
- data/spec/unit/type/file/{mtime.rb → mtime_spec.rb} +0 -0
- data/spec/unit/type/file/{type.rb → type_spec.rb} +0 -0
- data/spec/unit/type/file_spec.rb +2 -12
- data/spec/unit/type/host_spec.rb +14 -5
- data/spec/unit/type/mount_spec.rb +8 -0
- data/spec/unit/type/scheduled_task_spec.rb +2 -2
- data/spec/unit/util/adsi_spec.rb +23 -8
- data/spec/unit/util/command_line_spec.rb +11 -2
- data/spec/unit/util/feature_spec.rb +12 -1
- data/spec/unit/util/filetype_spec.rb +161 -55
- data/spec/unit/util/log_spec.rb +1 -1
- data/spec/unit/util/monkey_patches_spec.rb +7 -0
- data/spec/unit/util/rdoc_spec.rb +8 -2
- data/spec/unit/util/selinux_spec.rb +24 -32
- data/spec/unit/util/windows/sid_spec.rb +100 -0
- data/spec/unit/util/zaml_spec.rb +165 -25
- data/spec/unit/util_spec.rb +3 -9
- data/spec/watchr.rb +2 -6
- data/tasks/rake/gem.rake +4 -2
- data/tasks/rake/sign.rake +1 -1
- data/test/language/parser.rb +1 -0
- data/test/language/scope.rb +0 -5
- data/test/language/snippets.rb +1 -2
- data/test/lib/puppettest.rb +16 -27
- data/test/lib/puppettest/parsertesting.rb +0 -1
- data/test/network/authstore.rb +2 -4
- data/test/puppet/defaults.rb +0 -4
- data/test/util/fileparsing.rb +2 -6
- metadata +1706 -1617
- data/conf/osx/preflight +0 -24
- data/spec/spec.opts +0 -4
- data/spec/unit/file_collection/lookup_spec.rb +0 -45
- data/spec/unit/file_collection_spec.rb +0 -52
- data/tasks/rake/apple.rake +0 -176
- data/test/puppet/errortest.rb +0 -19
data/conf/osx/preflight
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
#
|
3
|
-
# Make sure that old puppet cruft is removed
|
4
|
-
# This also allows us to downgrade puppet as
|
5
|
-
# it's more likely that installing old versions
|
6
|
-
# over new will cause issues.
|
7
|
-
#
|
8
|
-
# ${3} is the destination volume so that this works correctly
|
9
|
-
# when being installed to volumes other than the current OS.
|
10
|
-
|
11
|
-
/bin/rm -Rf "${3}{SITELIBDIR}/puppet"
|
12
|
-
/bin/rm -Rf "${3}{SITELIBDIR}/puppet.rb"
|
13
|
-
|
14
|
-
# remove old doc files
|
15
|
-
|
16
|
-
/bin/rm -Rf "${3}/usr/share/doc/puppet"
|
17
|
-
|
18
|
-
# In puppet 0.24.x these executables lived in bindir, but in 0.25.x they
|
19
|
-
# have been moved to sbindir. This cleans out old ones before installing.
|
20
|
-
/bin/rm -Rf "${3}{BINDIR}/puppetca"
|
21
|
-
/bin/rm -Rf "${3}{BINDIR}/puppetd"
|
22
|
-
/bin/rm -Rf "${3}{BINDIR}/puppetmasterd"
|
23
|
-
/bin/rm -Rf "${3}{BINDIR}/puppetqd"
|
24
|
-
/bin/rm -Rf "${3}{BINDIR}/puppetrun"
|
data/spec/spec.opts
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
#!/usr/bin/env rspec
|
2
|
-
require 'spec_helper'
|
3
|
-
require 'puppet/file_collection/lookup'
|
4
|
-
|
5
|
-
class LookupTester
|
6
|
-
include Puppet::FileCollection::Lookup
|
7
|
-
end
|
8
|
-
|
9
|
-
describe Puppet::FileCollection::Lookup do
|
10
|
-
before do
|
11
|
-
@tester = LookupTester.new
|
12
|
-
|
13
|
-
@file_collection = mock 'file_collection'
|
14
|
-
Puppet::FileCollection.stubs(:collection).returns @file_collection
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should use the file collection to determine the index of the file name" do
|
18
|
-
@file_collection.expects(:index).with("/my/file").returns 50
|
19
|
-
|
20
|
-
@tester.file = "/my/file"
|
21
|
-
@tester.file_index.should == 50
|
22
|
-
end
|
23
|
-
|
24
|
-
it "should return nil as the file name if no index is set" do
|
25
|
-
@tester.file.should be_nil
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should use the file collection to convert the index to a file name" do
|
29
|
-
@file_collection.expects(:path).with(25).returns "/path/to/file"
|
30
|
-
|
31
|
-
@tester.file_index = 25
|
32
|
-
|
33
|
-
@tester.file.should == "/path/to/file"
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should support a line attribute" do
|
37
|
-
@tester.line = 50
|
38
|
-
@tester.line.should == 50
|
39
|
-
end
|
40
|
-
|
41
|
-
it "should default to the global file collection" do
|
42
|
-
Puppet::FileCollection.expects(:collection).returns "collection"
|
43
|
-
@tester.file_collection.should == "collection"
|
44
|
-
end
|
45
|
-
end
|
@@ -1,52 +0,0 @@
|
|
1
|
-
#!/usr/bin/env rspec
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
require 'puppet/file_collection'
|
5
|
-
|
6
|
-
describe Puppet::FileCollection do
|
7
|
-
before do
|
8
|
-
@collection = Puppet::FileCollection.new
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should be able to convert a file name into an index" do
|
12
|
-
@collection.index("/my/file").should be_instance_of(Fixnum)
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should be able to convert an index into a file name" do
|
16
|
-
index = @collection.index("/path/to/file")
|
17
|
-
@collection.path(index).should == "/path/to/file"
|
18
|
-
end
|
19
|
-
|
20
|
-
it "should always give the same file name for a given index" do
|
21
|
-
index = @collection.index("/path/to/file")
|
22
|
-
@collection.path(index).should == @collection.path(index)
|
23
|
-
end
|
24
|
-
|
25
|
-
it "should always give the same index for a given file name" do
|
26
|
-
@collection.index("/my/file").should == @collection.index("/my/file")
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should always correctly relate a file name and its index even when multiple files are in the collection" do
|
30
|
-
indexes = %w{a b c d e f}.inject({}) do |hash, letter|
|
31
|
-
hash[letter] = @collection.index("/path/to/file/#{letter}")
|
32
|
-
hash
|
33
|
-
end
|
34
|
-
|
35
|
-
indexes.each do |letter, index|
|
36
|
-
@collection.index("/path/to/file/#{letter}").should == indexes[letter]
|
37
|
-
@collection.path(index).should == @collection.path(index)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
it "should return nil as the file name when an unknown index is provided" do
|
42
|
-
@collection.path(50).should be_nil
|
43
|
-
end
|
44
|
-
|
45
|
-
it "should provide a global collection" do
|
46
|
-
Puppet::FileCollection.collection.should be_instance_of(Puppet::FileCollection)
|
47
|
-
end
|
48
|
-
|
49
|
-
it "should reuse the global collection" do
|
50
|
-
Puppet::FileCollection.collection.should equal(Puppet::FileCollection.collection)
|
51
|
-
end
|
52
|
-
end
|
data/tasks/rake/apple.rake
DELETED
@@ -1,176 +0,0 @@
|
|
1
|
-
# Title: Rake task to build Apple packages for Puppet.
|
2
|
-
# Author: Gary Larizza
|
3
|
-
# Date: 12/5/2011
|
4
|
-
# Description: This task will create a DMG-encapsulated package that will
|
5
|
-
# install Puppet on OS X systems. This happens by building
|
6
|
-
# a directory tree of files that will then be fed to the
|
7
|
-
# packagemaker binary (can be installed by installing the
|
8
|
-
# XCode Tools) which will create the .pkg file.
|
9
|
-
#
|
10
|
-
require 'fileutils'
|
11
|
-
require 'erb'
|
12
|
-
require 'find'
|
13
|
-
require 'pathname'
|
14
|
-
|
15
|
-
# Path to Binaries (Constants)
|
16
|
-
TAR = '/usr/bin/tar'
|
17
|
-
CP = '/bin/cp'
|
18
|
-
INSTALL = '/usr/bin/install'
|
19
|
-
DITTO = '/usr/bin/ditto'
|
20
|
-
PACKAGEMAKER = '/Developer/usr/bin/packagemaker'
|
21
|
-
SED = '/usr/bin/sed'
|
22
|
-
|
23
|
-
# Setup task to populate all the variables
|
24
|
-
task :setup do
|
25
|
-
@version = `git describe`.chomp
|
26
|
-
@title = "puppet-#{@version}"
|
27
|
-
@reverse_domain = 'com.puppetlabs.puppet'
|
28
|
-
@package_major_version = @version.split('.')[0]
|
29
|
-
@package_minor_version = @version.split('.')[1] +
|
30
|
-
@version.split('.')[2].split('-')[0].split('rc')[0]
|
31
|
-
@pm_restart = 'None'
|
32
|
-
@build_date = Time.new.strftime("%Y-%m-%dT%H:%M:%SZ")
|
33
|
-
end
|
34
|
-
|
35
|
-
# method: make_directory_tree
|
36
|
-
# description: This method sets up the directory structure that packagemaker
|
37
|
-
# needs to build a package. A prototype.plist file (holding
|
38
|
-
# package-specific options) is built from an ERB template located
|
39
|
-
# in the tasks/rake/templates directory.
|
40
|
-
def make_directory_tree
|
41
|
-
puppet_tmp = '/tmp/puppet'
|
42
|
-
@scratch = "#{puppet_tmp}/#{@title}"
|
43
|
-
@working_tree = {
|
44
|
-
'scripts' => "#{@scratch}/scripts",
|
45
|
-
'resources' => "#{@scratch}/resources",
|
46
|
-
'working' => "#{@scratch}/root",
|
47
|
-
'payload' => "#{@scratch}/payload",
|
48
|
-
}
|
49
|
-
puts "Cleaning Tree: #{puppet_tmp}"
|
50
|
-
FileUtils.rm_rf(puppet_tmp)
|
51
|
-
@working_tree.each do |key,val|
|
52
|
-
puts "Creating: #{val}"
|
53
|
-
FileUtils.mkdir_p(val)
|
54
|
-
end
|
55
|
-
File.open("#{@scratch}/#{'prototype.plist'}", "w+") do |f|
|
56
|
-
f.write(ERB.new(File.read('tasks/rake/templates/prototype.plist.erb')).result())
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
# method: build_dmg
|
61
|
-
# description: This method builds a package from the directory structure in
|
62
|
-
# /tmp/puppet and puts it in the
|
63
|
-
# /tmp/puppet/puppet-#{version}/payload directory. A DMG is
|
64
|
-
# created, using hdiutil, based on the contents of the
|
65
|
-
# /tmp/puppet/puppet-#{version}/payload directory. The resultant
|
66
|
-
# DMG is placed in the pkg/apple directory.
|
67
|
-
#
|
68
|
-
def build_dmg
|
69
|
-
# Local Variables
|
70
|
-
dmg_format_code = 'UDZO'
|
71
|
-
zlib_level = '9'
|
72
|
-
dmg_format_option = "-imagekey zlib-level=#{zlib_level}"
|
73
|
-
dmg_format = "#{dmg_format_code} #{dmg_format_option}"
|
74
|
-
dmg_file = "#{@title}.dmg"
|
75
|
-
package_file = "#{@title}.pkg"
|
76
|
-
pm_extra_args = '--verbose --no-recommend --no-relocate'
|
77
|
-
package_target_os = '10.4'
|
78
|
-
|
79
|
-
# Build .pkg file
|
80
|
-
system("sudo #{PACKAGEMAKER} --root #{@working_tree['working']} \
|
81
|
-
--id #{@reverse_domain} \
|
82
|
-
--filter DS_Store \
|
83
|
-
--target #{package_target_os} \
|
84
|
-
--title #{@title} \
|
85
|
-
--info #{@scratch}/prototype.plist \
|
86
|
-
--scripts #{@working_tree['scripts']} \
|
87
|
-
--resources #{@working_tree['resources']} \
|
88
|
-
--version #{@version} \
|
89
|
-
#{pm_extra_args} --out #{@working_tree['payload']}/#{package_file}")
|
90
|
-
|
91
|
-
# Build .dmg file
|
92
|
-
system("sudo hdiutil create -volname #{@title} \
|
93
|
-
-srcfolder #{@working_tree['payload']} \
|
94
|
-
-uid 99 \
|
95
|
-
-gid 99 \
|
96
|
-
-ov \
|
97
|
-
-format #{dmg_format} \
|
98
|
-
#{dmg_file}")
|
99
|
-
|
100
|
-
if File.directory?("#{Pathname.pwd}/pkg/apple")
|
101
|
-
FileUtils.mv("#{Pathname.pwd}/#{dmg_file}", "#{Pathname.pwd}/pkg/apple/#{dmg_file}")
|
102
|
-
puts "moved: #{dmg_file} has been moved to #{Pathname.pwd}/pkg/apple/#{dmg_file}"
|
103
|
-
else
|
104
|
-
FileUtils.mkdir_p("#{Pathname.pwd}/pkg/apple")
|
105
|
-
FileUtils.mv(dmg_file, "#{Pathname.pwd}/pkg/apple/#{dmg_file}")
|
106
|
-
puts "moved: #{dmg_file} has been moved to #{Pathname.pwd}/pkg/apple/#{dmg_file}"
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
# method: pack_puppet_source
|
111
|
-
# description: This method copies the puppet source into a directory
|
112
|
-
# structure in /tmp/puppet/puppet-#{version}/root mirroring the
|
113
|
-
# structure on the target system for which the package will be
|
114
|
-
# installed. Anything installed into /tmp/puppet/root will be
|
115
|
-
# installed as the package's payload.
|
116
|
-
#
|
117
|
-
def pack_puppet_source
|
118
|
-
work = "#{@working_tree['working']}"
|
119
|
-
puppet_source = Pathname.pwd
|
120
|
-
|
121
|
-
# Make all necessary directories
|
122
|
-
directories = ["#{work}/private/etc/puppet/",
|
123
|
-
"#{work}/usr/bin",
|
124
|
-
"#{work}/usr/sbin",
|
125
|
-
"#{work}/usr/share/doc/puppet",
|
126
|
-
"#{work}/usr/share/man/man5",
|
127
|
-
"#{work}/usr/share/man/man8",
|
128
|
-
"#{work}/usr/lib/ruby/site_ruby/1.8/puppet"]
|
129
|
-
FileUtils.mkdir_p(directories)
|
130
|
-
|
131
|
-
# Install necessary files
|
132
|
-
system("#{INSTALL} -o root -g wheel -m 644 #{puppet_source}/conf/auth.conf #{work}/private/etc/puppet/auth.conf")
|
133
|
-
system("#{DITTO} #{puppet_source}/bin/ #{work}/usr/bin")
|
134
|
-
system("#{DITTO} #{puppet_source}/sbin/ #{work}/usr/sbin")
|
135
|
-
system("#{INSTALL} -o root -g wheel -m 644 #{puppet_source}/man/man5/puppet.conf.5 #{work}/usr/share/man/man5/")
|
136
|
-
system("#{DITTO} #{puppet_source}/man/man8/ #{work}/usr/share/man/man8")
|
137
|
-
system("#{DITTO} #{puppet_source}/lib/ #{work}/usr/lib/ruby/site_ruby/1.8/")
|
138
|
-
|
139
|
-
# Setup a preflight script and replace variables in the files with
|
140
|
-
# the correct paths.
|
141
|
-
system("#{INSTALL} -o root -g wheel -m 644 #{puppet_source}/conf/osx/preflight #{@working_tree['scripts']}")
|
142
|
-
system("#{SED} -i '' \"s\#{SITELIBDIR}\#/usr/lib/ruby/site_ruby/1.8\#g\" #{@working_tree['scripts']}/preflight")
|
143
|
-
system("#{SED} -i '' \"s\#{BINDIR}\#/usr/bin\#g\" #{@working_tree['scripts']}/preflight")
|
144
|
-
|
145
|
-
# Install documentation (matching for files with capital letters)
|
146
|
-
Dir.foreach("#{puppet_source}") do |file|
|
147
|
-
system("#{INSTALL} -o root -g wheel -m 644 #{puppet_source}/#{file} #{work}/usr/share/doc/puppet") if file =~ /^[A-Z][A-Z]/
|
148
|
-
end
|
149
|
-
|
150
|
-
# Set Permissions
|
151
|
-
executable_directories = [ "#{work}/usr/bin",
|
152
|
-
"#{work}/usr/sbin",
|
153
|
-
"#{work}/usr/share/man/man8"]
|
154
|
-
FileUtils.chmod_R(0755, executable_directories)
|
155
|
-
FileUtils.chown_R('root', 'wheel', directories)
|
156
|
-
FileUtils.chmod_R(0644, "#{work}/usr/lib/ruby/site_ruby/1.8/")
|
157
|
-
FileUtils.chown_R('root', 'wheel', "#{work}/usr/lib/ruby/site_ruby/1.8/")
|
158
|
-
Find.find("#{work}/usr/lib/ruby/site_ruby/1.8/") do |dir|
|
159
|
-
FileUtils.chmod(0755, dir) if File.directory?(dir)
|
160
|
-
end
|
161
|
-
end
|
162
|
-
|
163
|
-
namespace :package do
|
164
|
-
desc "Task for building an Apple Package"
|
165
|
-
task :apple => [:setup] do
|
166
|
-
# Test for Root and Packagemaker binary
|
167
|
-
raise "Please run rake as root to build Apple Packages" unless Process.uid == 0
|
168
|
-
raise "Packagemaker must be installed. Please install XCode Tools" unless \
|
169
|
-
File.exists?('/Developer/usr/bin/packagemaker')
|
170
|
-
|
171
|
-
make_directory_tree
|
172
|
-
pack_puppet_source
|
173
|
-
build_dmg
|
174
|
-
FileUtils.chmod_R(0775, "#{Pathname.pwd}/pkg")
|
175
|
-
end
|
176
|
-
end
|
data/test/puppet/errortest.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require File.expand_path(File.dirname(__FILE__) + '/../lib/puppettest')
|
4
|
-
|
5
|
-
require 'puppet'
|
6
|
-
require 'puppettest'
|
7
|
-
|
8
|
-
class TestError < Test::Unit::TestCase
|
9
|
-
include PuppetTest
|
10
|
-
|
11
|
-
def test_errorisstring
|
12
|
-
error = nil
|
13
|
-
assert_nothing_raised {
|
14
|
-
error = Puppet::ParseError.new("This is an error")
|
15
|
-
}
|
16
|
-
assert_instance_of(String, error.to_s)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|