puppet 3.5.1-x86-mingw32 → 3.6.0.rc1-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.
- data/CONTRIBUTING.md +5 -0
- data/Gemfile +17 -9
- data/README.md +1 -0
- data/conf/fileserver.conf +4 -3
- data/ext/README.environment +8 -0
- data/ext/build_defaults.yaml +1 -1
- data/ext/debian/control +2 -2
- data/ext/debian/puppet-common.dirs +4 -0
- data/ext/debian/rules +4 -0
- data/ext/emacs/puppet-mode-init.el +1 -1
- data/ext/emacs/puppet-mode.el +36 -17
- data/ext/redhat/client.init +3 -3
- data/ext/redhat/puppet.spec.erb +9 -0
- data/ext/systemd/puppet.service +3 -4
- data/ext/systemd/puppetmaster.service +1 -3
- data/install.rb +1 -1
- data/lib/puppet.rb +2 -1
- data/lib/puppet/agent.rb +1 -1
- data/lib/puppet/application.rb +17 -17
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/configurer.rb +4 -1
- data/lib/puppet/configurer/downloader.rb +13 -12
- data/lib/puppet/configurer/plugin_handler.rb +3 -3
- data/lib/puppet/context.rb +6 -1
- data/lib/puppet/defaults.rb +82 -12
- data/lib/puppet/environments.rb +169 -13
- data/lib/puppet/external/nagios/grammar.ry +2 -0
- data/lib/puppet/external/nagios/parser.rb +28 -19
- data/lib/puppet/face/config.rb +19 -6
- data/lib/puppet/face/module/generate.rb +209 -7
- data/lib/puppet/face/module/install.rb +17 -16
- data/lib/puppet/face/module/list.rb +83 -82
- data/lib/puppet/face/module/search.rb +1 -1
- data/lib/puppet/face/module/upgrade.rb +10 -9
- data/lib/puppet/face/parser.rb +3 -2
- data/lib/puppet/face/plugin.rb +8 -4
- data/lib/puppet/file_bucket/dipper.rb +6 -3
- data/lib/puppet/file_bucket/file.rb +4 -2
- data/lib/puppet/file_serving/metadata.rb +1 -1
- data/lib/puppet/file_system/memory_file.rb +27 -1
- data/lib/puppet/file_system/memory_impl.rb +15 -1
- data/lib/puppet/forge.rb +148 -52
- data/lib/puppet/forge/cache.rb +5 -1
- data/lib/puppet/forge/errors.rb +10 -0
- data/lib/puppet/forge/repository.rb +61 -26
- data/lib/puppet/functions.rb +548 -0
- data/lib/puppet/functions/assert_type.rb +42 -0
- data/lib/puppet/functions/import.rb +7 -0
- data/lib/puppet/indirector/facts/facter.rb +1 -1
- data/lib/puppet/indirector/file_bucket_file/file.rb +3 -2
- data/lib/puppet/indirector/rest.rb +18 -0
- data/lib/puppet/loaders.rb +20 -0
- data/lib/puppet/module.rb +2 -2
- data/lib/puppet/module_tool.rb +40 -14
- data/lib/puppet/module_tool/applications.rb +0 -1
- data/lib/puppet/module_tool/applications/application.rb +35 -26
- data/lib/puppet/module_tool/applications/builder.rb +16 -6
- data/lib/puppet/module_tool/applications/checksummer.rb +25 -19
- data/lib/puppet/module_tool/applications/installer.rb +196 -35
- data/lib/puppet/module_tool/applications/searcher.rb +1 -0
- data/lib/puppet/module_tool/applications/uninstaller.rb +7 -1
- data/lib/puppet/module_tool/applications/unpacker.rb +57 -31
- data/lib/puppet/module_tool/applications/upgrader.rb +221 -65
- data/lib/puppet/module_tool/checksums.rb +5 -8
- data/lib/puppet/module_tool/errors/installer.rb +12 -44
- data/lib/puppet/module_tool/errors/shared.rb +84 -11
- data/lib/puppet/module_tool/errors/upgrader.rb +16 -45
- data/lib/puppet/module_tool/install_directory.rb +7 -6
- data/lib/puppet/module_tool/installed_modules.rb +92 -0
- data/lib/puppet/module_tool/local_tarball.rb +91 -0
- data/lib/puppet/module_tool/metadata.rb +119 -115
- data/lib/puppet/module_tool/modulefile.rb +9 -9
- data/lib/puppet/module_tool/shared_behaviors.rb +19 -7
- data/lib/puppet/module_tool/skeleton/templates/generator/README.md.erb +79 -0
- data/lib/puppet/module_tool/skeleton/templates/generator/Rakefile +18 -0
- data/lib/puppet/module_tool/skeleton/templates/generator/metadata.json.erb +1 -0
- data/lib/puppet/module_tool/skeleton/templates/generator/spec/classes/init_spec.rb.erb +7 -0
- data/lib/puppet/module_tool/tar.rb +3 -7
- data/lib/puppet/module_tool/tar/gnu.rb +21 -9
- data/lib/puppet/module_tool/tar/mini.rb +2 -8
- data/lib/puppet/network/http/api/v1.rb +1 -1
- data/lib/puppet/network/http/api/v2/authorization.rb +4 -2
- data/lib/puppet/network/http/issues.rb +1 -0
- data/lib/puppet/network/http_pool.rb +15 -6
- data/lib/puppet/node/environment.rb +91 -20
- data/lib/puppet/parser/ast/pops_bridge.rb +44 -3
- data/lib/puppet/parser/collector.rb +1 -1
- data/lib/puppet/parser/compiler.rb +50 -7
- data/lib/puppet/parser/functions.rb +6 -0
- data/lib/puppet/parser/functions/generate.rb +1 -1
- data/lib/puppet/parser/resource.rb +1 -1
- data/lib/puppet/pops.rb +22 -1
- data/lib/puppet/pops/adapters.rb +8 -1
- data/lib/puppet/pops/binder/bindings_composer.rb +1 -1
- data/lib/puppet/pops/binder/bindings_factory.rb +1 -1
- data/lib/puppet/pops/binder/config/binder_config_checker.rb +1 -1
- data/lib/puppet/pops/binder/producers.rb +2 -2
- data/lib/puppet/pops/evaluator/access_operator.rb +65 -25
- data/lib/puppet/pops/evaluator/callable_signature.rb +101 -0
- data/lib/puppet/pops/evaluator/closure.rb +57 -2
- data/lib/puppet/pops/evaluator/compare_operator.rb +1 -1
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +9 -11
- data/lib/puppet/pops/evaluator/runtime3_support.rb +72 -21
- data/lib/puppet/pops/functions/dispatch.rb +71 -0
- data/lib/puppet/pops/functions/dispatcher.rb +237 -0
- data/lib/puppet/pops/functions/function.rb +77 -0
- data/lib/puppet/pops/issues.rb +12 -0
- data/lib/puppet/pops/loader/base_loader.rb +102 -0
- data/lib/puppet/pops/loader/dependency_loader.rb +60 -0
- data/lib/puppet/pops/loader/gem_support.rb +49 -0
- data/lib/puppet/pops/loader/loader.rb +180 -0
- data/lib/puppet/pops/loader/loader_paths.rb +137 -0
- data/lib/puppet/pops/loader/module_loaders.rb +242 -0
- data/lib/puppet/pops/loader/null_loader.rb +44 -0
- data/lib/puppet/pops/loader/ruby_function_instantiator.rb +34 -0
- data/lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb +109 -0
- data/lib/puppet/pops/loader/simple_environment_loader.rb +20 -0
- data/lib/puppet/pops/loader/static_loader.rb +69 -0
- data/lib/puppet/pops/loader/uri_helper.rb +22 -0
- data/lib/puppet/pops/loaders.rb +240 -0
- data/lib/puppet/pops/model/factory.rb +13 -5
- data/lib/puppet/pops/model/model_tree_dumper.rb +12 -4
- data/lib/puppet/pops/parser/egrammar.ra +31 -18
- data/lib/puppet/pops/parser/eparser.rb +1137 -1106
- data/lib/puppet/pops/parser/lexer2.rb +17 -16
- data/lib/puppet/pops/semantic_error.rb +17 -0
- data/lib/puppet/pops/types/type_calculator.rb +150 -15
- data/lib/puppet/pops/types/type_factory.rb +69 -0
- data/lib/puppet/pops/types/type_parser.rb +9 -0
- data/lib/puppet/pops/types/types.rb +65 -4
- data/lib/puppet/pops/validation/checker4_0.rb +1 -1
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +1 -1
- data/lib/puppet/property/list.rb +1 -1
- data/lib/puppet/provider/augeas/augeas.rb +2 -2
- data/lib/puppet/provider/cron/crontab.rb +13 -2
- data/lib/puppet/provider/package.rb +24 -0
- data/lib/puppet/provider/package/apt.rb +6 -1
- data/lib/puppet/provider/package/gem.rb +8 -2
- data/lib/puppet/provider/package/msi.rb +0 -15
- data/lib/puppet/provider/package/openbsd.rb +0 -24
- data/lib/puppet/provider/package/rpm.rb +3 -29
- data/lib/puppet/provider/package/windows.rb +0 -15
- data/lib/puppet/provider/package/yum.rb +101 -24
- data/lib/puppet/provider/package/yumhelper.py +31 -1
- data/lib/puppet/provider/package/zypper.rb +10 -28
- data/lib/puppet/provider/service/debian.rb +1 -1
- data/lib/puppet/provider/service/init.rb +3 -0
- data/lib/puppet/provider/service/openbsd.rb +318 -0
- data/lib/puppet/provider/service/redhat.rb +6 -3
- data/lib/puppet/provider/service/systemd.rb +2 -2
- data/lib/puppet/provider/yumrepo/inifile.rb +115 -42
- data/lib/puppet/resource.rb +13 -9
- data/lib/puppet/resource/catalog.rb +12 -6
- data/lib/puppet/resource/type_collection.rb +3 -3
- data/lib/puppet/settings.rb +57 -36
- data/lib/puppet/settings/config_file.rb +5 -0
- data/lib/puppet/settings/environment_conf.rb +147 -0
- data/lib/puppet/settings/ttl_setting.rb +48 -0
- data/lib/puppet/ssl/certificate_authority.rb +2 -3
- data/lib/puppet/ssl/certificate_authority/autosign_command.rb +1 -1
- data/lib/puppet/ssl/certificate_request.rb +4 -4
- data/lib/puppet/ssl/validator/default_validator.rb +2 -2
- data/lib/puppet/status.rb +1 -1
- data/lib/puppet/test/test_helper.rb +1 -0
- data/lib/puppet/type/augeas.rb +13 -1
- data/lib/puppet/type/cron.rb +32 -18
- data/lib/puppet/type/file.rb +4 -2
- data/lib/puppet/type/file/checksum.rb +15 -5
- data/lib/puppet/type/file/content.rb +3 -1
- data/lib/puppet/type/file/source.rb +5 -5
- data/lib/puppet/type/package.rb +12 -17
- data/lib/puppet/type/resources.rb +3 -1
- data/lib/puppet/type/scheduled_task.rb +4 -5
- data/lib/puppet/type/service.rb +12 -2
- data/lib/puppet/type/user.rb +106 -0
- data/lib/puppet/type/yumrepo.rb +9 -1
- data/lib/puppet/util/checksums.rb +60 -1
- data/lib/puppet/util/diff.rb +3 -1
- data/lib/puppet/util/execution.rb +20 -16
- data/lib/puppet/util/feature.rb +3 -0
- data/lib/puppet/util/logging.rb +19 -12
- data/lib/puppet/util/rubygems.rb +10 -0
- data/lib/puppet/util/watched_file.rb +1 -1
- data/lib/puppet/util/windows/security.rb +5 -3
- data/lib/puppet/vendor/load_semantic.rb +1 -0
- data/lib/puppet/vendor/require_vendored.rb +2 -0
- data/lib/puppet/vendor/semantic/Gemfile +20 -0
- data/lib/puppet/vendor/semantic/Rakefile +69 -0
- data/lib/puppet/vendor/semantic/lib/semantic.rb +7 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency.rb +181 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/graph.rb +60 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/graph_node.rb +117 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/module_release.rb +46 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/source.rb +25 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/unsatisfiable_graph.rb +31 -0
- data/lib/puppet/vendor/semantic/lib/semantic/version.rb +168 -0
- data/lib/puppet/vendor/semantic/lib/semantic/version_range.rb +424 -0
- data/lib/puppet/vendor/semantic/spec/spec_helper.rb +24 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/graph_node_spec.rb +141 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/graph_spec.rb +162 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/module_release_spec.rb +143 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/source_spec.rb +5 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/unsatisfiable_graph_spec.rb +44 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency_spec.rb +383 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/version_range_spec.rb +307 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/version_spec.rb +608 -0
- data/lib/puppet/version.rb +1 -1
- data/spec/fixtures/java.tgz +0 -0
- data/spec/fixtures/stdlib.tgz +0 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/usee/lib/puppet/functions/usee/callee.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/user/lib/puppet/functions/user/caller.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/user/metadata.json +9 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/modulea/rb_func_a.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/rb_func_a.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/manifests/init.pp +3 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/metadata.json +19 -0
- data/spec/fixtures/unit/pops/loaders/loaders/wo_metadata_module/modules/moduleb/lib/puppet/functions/moduleb/rb_func_b.rb +6 -0
- data/spec/fixtures/unit/pops/loaders/loaders/wo_metadata_module/modules/moduleb/manifests/init.pp +3 -0
- data/spec/fixtures/unit/provider/naginator/define_empty_param +6 -0
- data/spec/fixtures/unit/provider/service/systemd/list_unit_files_services +7 -0
- data/spec/fixtures/unit/type/user/authorized_keys +5 -0
- data/spec/integration/application/apply_spec.rb +1 -2
- data/spec/integration/configurer_spec.rb +2 -2
- data/spec/integration/faces/plugin_spec.rb +62 -0
- data/spec/integration/indirector/catalog/compiler_spec.rb +1 -1
- data/spec/integration/indirector/catalog/queue_spec.rb +1 -1
- data/spec/integration/node/environment_spec.rb +2 -2
- data/spec/integration/parser/future_compiler_spec.rb +96 -142
- data/spec/integration/parser/ruby_manifest_spec.rb +0 -5
- data/spec/integration/provider/cron/crontab_spec.rb +35 -0
- data/spec/integration/type/file_spec.rb +74 -72
- data/spec/integration/util/windows/security_spec.rb +17 -0
- data/spec/lib/matchers/resource.rb +45 -13
- data/spec/lib/puppet_spec/files.rb +18 -0
- data/spec/lib/puppet_spec/module_tool/shared_functions.rb +56 -0
- data/spec/lib/puppet_spec/module_tool/stub_source.rb +133 -0
- data/spec/shared_contexts/checksums.rb +55 -0
- data/spec/unit/application/apply_spec.rb +10 -7
- data/spec/unit/application/doc_spec.rb +17 -10
- data/spec/unit/application/indirection_base_spec.rb +18 -10
- data/spec/unit/application/inspect_spec.rb +22 -20
- data/spec/unit/configurer/downloader_spec.rb +7 -6
- data/spec/unit/configurer/plugin_handler_spec.rb +5 -8
- data/spec/unit/configurer_spec.rb +1 -1
- data/spec/unit/context_spec.rb +23 -0
- data/spec/unit/environments_spec.rb +274 -16
- data/spec/unit/face/config_spec.rb +111 -11
- data/spec/unit/face/module/install_spec.rb +14 -85
- data/spec/unit/face/module/list_spec.rb +108 -62
- data/spec/unit/face/module/search_spec.rb +1 -1
- data/spec/unit/face/module/uninstall_spec.rb +21 -42
- data/spec/unit/face/parser_spec.rb +5 -2
- data/spec/unit/file_bucket/dipper_spec.rb +92 -86
- data/spec/unit/file_bucket/file_spec.rb +23 -75
- data/spec/unit/file_serving/metadata_spec.rb +74 -74
- data/spec/unit/forge/module_release_spec.rb +131 -0
- data/spec/unit/forge/repository_spec.rb +21 -20
- data/spec/unit/forge_spec.rb +99 -23
- data/spec/unit/functions/assert_type_spec.rb +59 -0
- data/spec/unit/functions4_spec.rb +671 -0
- data/spec/unit/indirector/catalog/static_compiler_spec.rb +2 -2
- data/spec/unit/indirector/facts/facter_spec.rb +9 -3
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +156 -155
- data/spec/unit/indirector/rest_spec.rb +8 -0
- data/spec/unit/interface/face_collection_spec.rb +35 -23
- data/spec/unit/module_spec.rb +20 -8
- data/spec/unit/module_tool/applications/builder_spec.rb +40 -12
- data/spec/unit/module_tool/applications/checksummer_spec.rb +86 -105
- data/spec/unit/module_tool/applications/installer_spec.rb +293 -261
- data/spec/unit/module_tool/applications/searcher_spec.rb +1 -1
- data/spec/unit/module_tool/applications/uninstaller_spec.rb +90 -154
- data/spec/unit/module_tool/applications/unpacker_spec.rb +12 -12
- data/spec/unit/module_tool/applications/upgrader_spec.rb +286 -18
- data/spec/unit/module_tool/metadata_spec.rb +223 -14
- data/spec/unit/module_tool/tar/gnu_spec.rb +12 -9
- data/spec/unit/module_tool/tar/mini_spec.rb +1 -1
- data/spec/unit/module_tool/tar_spec.rb +4 -18
- data/spec/unit/module_tool_spec.rb +123 -27
- data/spec/unit/network/formats_spec.rb +2 -2
- data/spec/unit/network/http_pool_spec.rb +21 -0
- data/spec/unit/network/rights_spec.rb +10 -8
- data/spec/unit/node/environment_spec.rb +27 -2
- data/spec/unit/parser/collector_spec.rb +1 -1
- data/spec/unit/parser/compiler_spec.rb +1 -1
- data/spec/unit/parser/functions/generate_spec.rb +4 -0
- data/spec/unit/pops/evaluator/access_ops_spec.rb +50 -11
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +25 -0
- data/spec/unit/pops/loaders/dependency_loader_spec.rb +44 -0
- data/spec/unit/pops/loaders/loader_paths_spec.rb +66 -0
- data/spec/unit/pops/loaders/loaders_spec.rb +105 -0
- data/spec/unit/pops/loaders/module_loaders_spec.rb +119 -0
- data/spec/unit/pops/loaders/static_loader_spec.rb +46 -0
- data/spec/unit/pops/types/type_calculator_spec.rb +145 -10
- data/spec/unit/pops/types/type_factory_spec.rb +101 -0
- data/spec/unit/pops/types/type_parser_spec.rb +22 -0
- data/spec/unit/property/list_spec.rb +9 -1
- data/spec/unit/provider/augeas/augeas_spec.rb +58 -11
- data/spec/unit/provider/cron/crontab_spec.rb +1 -0
- data/spec/unit/provider/cron/parsed_spec.rb +15 -0
- data/spec/unit/provider/naginator_spec.rb +14 -0
- data/spec/unit/provider/package/apt_spec.rb +78 -64
- data/spec/unit/provider/package/gem_spec.rb +15 -0
- data/spec/unit/provider/package/rpm_spec.rb +6 -6
- data/spec/unit/provider/package/windows_spec.rb +1 -1
- data/spec/unit/provider/package/yum_spec.rb +199 -104
- data/spec/unit/provider/package/zypper_spec.rb +41 -15
- data/spec/unit/provider/service/openbsd_spec.rb +129 -22
- data/spec/unit/provider/service/redhat_spec.rb +18 -4
- data/spec/unit/provider/service/systemd_spec.rb +5 -9
- data/spec/unit/provider/service/upstart_spec.rb +1 -1
- data/spec/unit/provider/user/directoryservice_spec.rb +10 -0
- data/spec/unit/provider/yumrepo/inifile_spec.rb +171 -15
- data/spec/unit/resource/catalog_spec.rb +20 -104
- data/spec/unit/resource/type_collection_spec.rb +10 -9
- data/spec/unit/settings/config_file_spec.rb +29 -6
- data/spec/unit/settings/environment_conf_spec.rb +51 -0
- data/spec/unit/settings_spec.rb +97 -12
- data/spec/unit/ssl/certificate_authority_spec.rb +2 -0
- data/spec/unit/type/augeas_spec.rb +1 -1
- data/spec/unit/type/cron_spec.rb +6 -7
- data/spec/unit/type/file/checksum_spec.rb +6 -0
- data/spec/unit/type/file/content_spec.rb +277 -207
- data/spec/unit/type/file_spec.rb +9 -7
- data/spec/unit/type/user_spec.rb +106 -18
- data/spec/unit/type/yumrepo_spec.rb +8 -0
- data/spec/unit/util/checksums_spec.rb +12 -5
- data/spec/unit/util/diff_spec.rb +8 -0
- data/spec/unit/util/execution_spec.rb +4 -4
- data/spec/unit/util/feature_spec.rb +2 -0
- data/spec/unit/util/logging_spec.rb +14 -4
- data/spec/unit/util/rdoc/parser_spec.rb +5 -4
- data/spec/unit/util/rubygems_spec.rb +14 -0
- data/tasks/parallel.rake +2 -2
- metadata +154 -21
- checksums.yaml +0 -7
- data/lib/puppet/module_tool/applications/generator.rb +0 -142
- data/lib/puppet/module_tool/skeleton.rb +0 -37
- data/lib/puppet/module_tool/skeleton/templates/generator/Modulefile.erb +0 -11
- data/lib/puppet/module_tool/skeleton/templates/generator/README.erb +0 -16
- data/lib/puppet/module_tool/tar/solaris.rb +0 -5
- data/spec/fixtures/unit/provider/service/systemd/list_units_services +0 -17
- data/spec/unit/module_tool/tar/solaris_spec.rb +0 -22
@@ -8,12 +8,7 @@ describe "Pure ruby manifests" do
|
|
8
8
|
include PuppetSpec::Files
|
9
9
|
|
10
10
|
before do
|
11
|
-
@node = Puppet::Node.new "testnode"
|
12
|
-
|
13
|
-
@scope_resource = stub 'scope_resource', :builtin? => true, :finish => nil, :ref => 'Class[main]'
|
14
|
-
@scope = stub 'scope', :resource => @scope_resource, :source => mock("source")
|
15
11
|
@test_dir = tmpdir('ruby_manifest_test')
|
16
|
-
Puppet.expects(:deprecation_warning).at_least(1)
|
17
12
|
end
|
18
13
|
|
19
14
|
after do
|
@@ -109,6 +109,30 @@ describe Puppet::Type.type(:cron).provider(:crontab), '(integration)', :unless =
|
|
109
109
|
end
|
110
110
|
|
111
111
|
describe "with ensure present" do
|
112
|
+
|
113
|
+
context "and no command specified" do
|
114
|
+
it "should work if the resource is already present" do
|
115
|
+
resource = Puppet::Type.type(:cron).new(
|
116
|
+
:name => 'My daily failure',
|
117
|
+
:special => 'daily',
|
118
|
+
:target => crontab_user1,
|
119
|
+
:user => crontab_user1
|
120
|
+
)
|
121
|
+
run_in_catalog(resource)
|
122
|
+
expect_output('crontab_user1')
|
123
|
+
end
|
124
|
+
it "should fail if the resource needs creating" do
|
125
|
+
resource = Puppet::Type.type(:cron).new(
|
126
|
+
:name => 'Entirely new resource',
|
127
|
+
:special => 'daily',
|
128
|
+
:target => crontab_user1,
|
129
|
+
:user => crontab_user1
|
130
|
+
)
|
131
|
+
resource.expects(:err).with(regexp_matches(/no command/))
|
132
|
+
run_in_catalog(resource)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
112
136
|
it "should do nothing if entry already present" do
|
113
137
|
resource = Puppet::Type.type(:cron).new(
|
114
138
|
:name => 'My daily failure',
|
@@ -121,6 +145,17 @@ describe Puppet::Type.type(:cron).provider(:crontab), '(integration)', :unless =
|
|
121
145
|
expect_output('crontab_user1')
|
122
146
|
end
|
123
147
|
|
148
|
+
it "should work correctly when managing 'target' but not 'user'" do
|
149
|
+
resource = Puppet::Type.type(:cron).new(
|
150
|
+
:name => 'My daily failure',
|
151
|
+
:special => 'daily',
|
152
|
+
:command => '/bin/false',
|
153
|
+
:target => crontab_user1
|
154
|
+
)
|
155
|
+
run_in_catalog(resource)
|
156
|
+
expect_output('crontab_user1')
|
157
|
+
end
|
158
|
+
|
124
159
|
it "should do nothing if a matching entry already present" do
|
125
160
|
resource = Puppet::Type.type(:cron).new(
|
126
161
|
:name => 'no_such_named_resource_in_crontab',
|
@@ -10,7 +10,7 @@ if Puppet.features.microsoft_windows?
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
describe Puppet::Type.type(:file) do
|
13
|
+
describe Puppet::Type.type(:file), :uses_checksums => true do
|
14
14
|
include PuppetSpec::Files
|
15
15
|
|
16
16
|
let(:catalog) { Puppet::Resource::Catalog.new }
|
@@ -402,109 +402,111 @@ describe Puppet::Type.type(:file) do
|
|
402
402
|
end
|
403
403
|
|
404
404
|
describe "when writing files" do
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
405
|
+
with_digest_algorithms do
|
406
|
+
it "should backup files to a filebucket when one is configured" do
|
407
|
+
filebucket = Puppet::Type.type(:filebucket).new :path => tmpfile("filebucket"), :name => "mybucket"
|
408
|
+
file = described_class.new :path => path, :backup => "mybucket", :content => "foo"
|
409
|
+
catalog.add_resource file
|
410
|
+
catalog.add_resource filebucket
|
410
411
|
|
411
|
-
|
412
|
+
File.open(file[:path], "w") { |f| f.write("bar") }
|
412
413
|
|
413
|
-
|
414
|
+
d = digest(IO.binread(file[:path]))
|
414
415
|
|
415
|
-
|
416
|
+
catalog.apply
|
416
417
|
|
417
|
-
|
418
|
-
|
418
|
+
filebucket.bucket.getfile(d).should == "bar"
|
419
|
+
end
|
419
420
|
|
420
|
-
|
421
|
-
|
422
|
-
|
421
|
+
it "should backup files in the local directory when a backup string is provided" do
|
422
|
+
file = described_class.new :path => path, :backup => ".bak", :content => "foo"
|
423
|
+
catalog.add_resource file
|
423
424
|
|
424
|
-
|
425
|
+
File.open(file[:path], "w") { |f| f.puts "bar" }
|
425
426
|
|
426
|
-
|
427
|
+
catalog.apply
|
427
428
|
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
429
|
+
backup = file[:path] + ".bak"
|
430
|
+
Puppet::FileSystem.exist?(backup).should be_true
|
431
|
+
File.read(backup).should == "bar\n"
|
432
|
+
end
|
432
433
|
|
433
|
-
|
434
|
-
|
434
|
+
it "should fail if no backup can be performed" do
|
435
|
+
dir = tmpdir("backups")
|
435
436
|
|
436
|
-
|
437
|
-
|
437
|
+
file = described_class.new :path => File.join(dir, "testfile"), :backup => ".bak", :content => "foo"
|
438
|
+
catalog.add_resource file
|
438
439
|
|
439
|
-
|
440
|
+
File.open(file[:path], 'w') { |f| f.puts "bar" }
|
440
441
|
|
441
|
-
|
442
|
-
|
442
|
+
# Create a directory where the backup should be so that writing to it fails
|
443
|
+
Dir.mkdir(File.join(dir, "testfile.bak"))
|
443
444
|
|
444
|
-
|
445
|
+
Puppet::Util::Log.stubs(:newmessage)
|
445
446
|
|
446
|
-
|
447
|
+
catalog.apply
|
447
448
|
|
448
|
-
|
449
|
-
|
449
|
+
File.read(file[:path]).should == "bar\n"
|
450
|
+
end
|
450
451
|
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
452
|
+
it "should not backup symlinks", :if => described_class.defaultprovider.feature?(:manages_symlinks) do
|
453
|
+
link = tmpfile("link")
|
454
|
+
dest1 = tmpfile("dest1")
|
455
|
+
dest2 = tmpfile("dest2")
|
456
|
+
bucket = Puppet::Type.type(:filebucket).new :path => tmpfile("filebucket"), :name => "mybucket"
|
457
|
+
file = described_class.new :path => link, :target => dest2, :ensure => :link, :backup => "mybucket"
|
458
|
+
catalog.add_resource file
|
459
|
+
catalog.add_resource bucket
|
459
460
|
|
460
|
-
|
461
|
-
|
461
|
+
File.open(dest1, "w") { |f| f.puts "whatever" }
|
462
|
+
Puppet::FileSystem.symlink(dest1, link)
|
462
463
|
|
463
|
-
|
464
|
+
d = digest(File.read(file[:path]))
|
464
465
|
|
465
|
-
|
466
|
+
catalog.apply
|
466
467
|
|
467
|
-
|
468
|
-
|
469
|
-
|
468
|
+
Puppet::FileSystem.readlink(link).should == dest2
|
469
|
+
Puppet::FileSystem.exist?(bucket[:path]).should be_false
|
470
|
+
end
|
470
471
|
|
471
|
-
|
472
|
-
|
473
|
-
|
472
|
+
it "should backup directories to the local filesystem by copying the whole directory" do
|
473
|
+
file = described_class.new :path => path, :backup => ".bak", :content => "foo", :force => true
|
474
|
+
catalog.add_resource file
|
474
475
|
|
475
|
-
|
476
|
+
Dir.mkdir(path)
|
476
477
|
|
477
|
-
|
478
|
-
|
478
|
+
otherfile = File.join(path, "foo")
|
479
|
+
File.open(otherfile, "w") { |f| f.print "yay" }
|
479
480
|
|
480
|
-
|
481
|
+
catalog.apply
|
481
482
|
|
482
|
-
|
483
|
-
|
483
|
+
backup = "#{path}.bak"
|
484
|
+
FileTest.should be_directory(backup)
|
484
485
|
|
485
|
-
|
486
|
-
|
486
|
+
File.read(File.join(backup, "foo")).should == "yay"
|
487
|
+
end
|
487
488
|
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
489
|
+
it "should backup directories to filebuckets by backing up each file separately" do
|
490
|
+
bucket = Puppet::Type.type(:filebucket).new :path => tmpfile("filebucket"), :name => "mybucket"
|
491
|
+
file = described_class.new :path => tmpfile("bucket_backs"), :backup => "mybucket", :content => "foo", :force => true
|
492
|
+
catalog.add_resource file
|
493
|
+
catalog.add_resource bucket
|
493
494
|
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
495
|
+
Dir.mkdir(file[:path])
|
496
|
+
foofile = File.join(file[:path], "foo")
|
497
|
+
barfile = File.join(file[:path], "bar")
|
498
|
+
File.open(foofile, "w") { |f| f.print "fooyay" }
|
499
|
+
File.open(barfile, "w") { |f| f.print "baryay" }
|
499
500
|
|
500
501
|
|
501
|
-
|
502
|
-
|
502
|
+
food = digest(File.read(foofile))
|
503
|
+
bard = digest(File.read(barfile))
|
503
504
|
|
504
|
-
|
505
|
+
catalog.apply
|
505
506
|
|
506
|
-
|
507
|
-
|
507
|
+
bucket.bucket.getfile(food).should == "fooyay"
|
508
|
+
bucket.bucket.getfile(bard).should == "baryay"
|
509
|
+
end
|
508
510
|
end
|
509
511
|
end
|
510
512
|
|
@@ -826,6 +826,23 @@ describe "Puppet::Util::Windows::Security", :if => Puppet.features.microsoft_win
|
|
826
826
|
end.should_not be_nil
|
827
827
|
end
|
828
828
|
|
829
|
+
it "allows deny ACEs with inheritance" do
|
830
|
+
# inheritance can only be set on directories
|
831
|
+
dir = tmpdir('denyaces')
|
832
|
+
|
833
|
+
inherit_flags = Puppet::Util::Windows::AccessControlEntry::OBJECT_INHERIT_ACE |
|
834
|
+
Puppet::Util::Windows::AccessControlEntry::CONTAINER_INHERIT_ACE
|
835
|
+
|
836
|
+
sd = winsec.get_security_descriptor(dir)
|
837
|
+
sd.dacl.deny(sids[:guest], Windows::File::FILE_ALL_ACCESS, inherit_flags)
|
838
|
+
winsec.set_security_descriptor(dir, sd)
|
839
|
+
|
840
|
+
sd = winsec.get_security_descriptor(dir)
|
841
|
+
sd.dacl.find do |ace|
|
842
|
+
ace.sid == sids[:guest] && ace.flags != 0
|
843
|
+
end.should_not be_nil
|
844
|
+
end
|
845
|
+
|
829
846
|
context "when managing mode" do
|
830
847
|
it "removes aces for sids that are neither the owner nor group" do
|
831
848
|
# add a guest ace, it's never owner or group
|
@@ -1,23 +1,55 @@
|
|
1
1
|
module Matchers; module Resource
|
2
2
|
extend RSpec::Matchers::DSL
|
3
3
|
|
4
|
-
matcher :
|
4
|
+
matcher :be_resource do |expected_resource|
|
5
5
|
@params = {}
|
6
6
|
|
7
|
-
match do |
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
match do |actual_resource|
|
8
|
+
matched = true
|
9
|
+
failures = []
|
10
|
+
|
11
|
+
if actual_resource.ref != expected_resource
|
12
|
+
matched = false
|
13
|
+
failures << "expected #{expected_resource} but was #{actual_resource.ref}"
|
14
|
+
end
|
15
|
+
|
16
|
+
@params.each do |name, value|
|
17
|
+
case value
|
18
|
+
when RSpec::Matchers::DSL::Matcher
|
19
|
+
if !value.matches?(actual_resource[name])
|
14
20
|
matched = false
|
15
|
-
failures << "expected #{name} to
|
21
|
+
failures << "expected #{name} to match '#{value.description}' but was '#{actual_resource[name]}'"
|
22
|
+
end
|
23
|
+
else
|
24
|
+
if actual_resource[name] != value
|
25
|
+
matched = false
|
26
|
+
failures << "expected #{name} to be '#{value}' but was '#{actual_resource[name]}'"
|
16
27
|
end
|
17
28
|
end
|
18
|
-
|
29
|
+
end
|
30
|
+
@mismatch = failures.join("\n")
|
31
|
+
|
32
|
+
matched
|
33
|
+
end
|
19
34
|
|
20
|
-
|
35
|
+
chain :with_parameter do |name, value|
|
36
|
+
@params[name] = value
|
37
|
+
end
|
38
|
+
|
39
|
+
def failure_message_for_should
|
40
|
+
@mismatch
|
41
|
+
end
|
42
|
+
end
|
43
|
+
module_function :be_resource
|
44
|
+
|
45
|
+
matcher :have_resource do |expected_resource|
|
46
|
+
@params = {}
|
47
|
+
@matcher = Matchers::Resource.be_resource(expected_resource)
|
48
|
+
|
49
|
+
match do |actual_catalog|
|
50
|
+
@mismatch = ""
|
51
|
+
if resource = actual_catalog.resource(expected_resource)
|
52
|
+
@matcher.matches?(resource)
|
21
53
|
else
|
22
54
|
@mismatch = "expected #{@actual.to_dot} to include #{@expected[0]}"
|
23
55
|
false
|
@@ -25,11 +57,11 @@ module Matchers; module Resource
|
|
25
57
|
end
|
26
58
|
|
27
59
|
chain :with_parameter do |name, value|
|
28
|
-
@
|
60
|
+
@matcher.with_parameter(name, value)
|
29
61
|
end
|
30
62
|
|
31
63
|
def failure_message_for_should
|
32
|
-
@mismatch
|
64
|
+
@mismatch.empty? ? @matcher.failure_message_for_should : @mismatch
|
33
65
|
end
|
34
66
|
end
|
35
67
|
end; end
|
@@ -52,6 +52,24 @@ module PuppetSpec::Files
|
|
52
52
|
dir
|
53
53
|
end
|
54
54
|
|
55
|
+
def dir_containing(name, contents_hash) PuppetSpec::Files.dir_containing(name, contents_hash) end
|
56
|
+
def self.dir_containing(name, contents_hash)
|
57
|
+
dir_contained_in(tmpdir(name), contents_hash)
|
58
|
+
end
|
59
|
+
|
60
|
+
def self.dir_contained_in(dir, contents_hash)
|
61
|
+
contents_hash.each do |k,v|
|
62
|
+
if v.is_a?(Hash)
|
63
|
+
Dir.mkdir(tmp = File.join(dir,k))
|
64
|
+
dir_contained_in(tmp, v)
|
65
|
+
else
|
66
|
+
file = File.join(dir, k)
|
67
|
+
File.open(file, 'wb') {|f| f.write(v) }
|
68
|
+
end
|
69
|
+
end
|
70
|
+
dir
|
71
|
+
end
|
72
|
+
|
55
73
|
def self.record_tmp(tmp)
|
56
74
|
# ...record it for cleanup,
|
57
75
|
$global_tempfiles ||= []
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
module PuppetSpec
|
4
|
+
module ModuleTool
|
5
|
+
module SharedFunctions
|
6
|
+
def remote_release(name, version)
|
7
|
+
remote_source.available_releases[name][version]
|
8
|
+
end
|
9
|
+
|
10
|
+
def preinstall(name, version, options = { :into => primary_dir })
|
11
|
+
release = remote_release(name, version)
|
12
|
+
raise "Could not preinstall #{name} v#{version}" if release.nil?
|
13
|
+
|
14
|
+
name = release.name[/-(.*)/, 1]
|
15
|
+
moddir = File.join(options[:into], name)
|
16
|
+
FileUtils.mkdir_p(moddir)
|
17
|
+
File.open(File.join(moddir, 'metadata.json'), 'w') do |file|
|
18
|
+
file.puts(JSON.generate(release.metadata))
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def mark_changed(path)
|
23
|
+
app = Puppet::ModuleTool::Applications::Checksummer
|
24
|
+
app.stubs(:run).with(path).returns(['README'])
|
25
|
+
end
|
26
|
+
|
27
|
+
def graph_should_include(name, options)
|
28
|
+
releases = flatten_graph(subject[:graph] || [])
|
29
|
+
release = releases.find { |x| x[:name] == name }
|
30
|
+
|
31
|
+
if options.nil?
|
32
|
+
release.should be_nil
|
33
|
+
else
|
34
|
+
from = options.keys.find { |k| k.nil? || k.is_a?(Semantic::Version) }
|
35
|
+
to = options.delete(from)
|
36
|
+
|
37
|
+
if to or from
|
38
|
+
options[:previous_version] ||= from
|
39
|
+
options[:version] ||= to
|
40
|
+
end
|
41
|
+
|
42
|
+
release.should_not be_nil
|
43
|
+
release.should include options
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def flatten_graph(graph)
|
48
|
+
graph + graph.map { |sub| flatten_graph(sub[:dependencies]) }.flatten
|
49
|
+
end
|
50
|
+
|
51
|
+
def v(str)
|
52
|
+
Semantic::Version.parse(str)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,133 @@
|
|
1
|
+
module PuppetSpec
|
2
|
+
module ModuleTool
|
3
|
+
class StubSource < Semantic::Dependency::Source
|
4
|
+
def inspect; "Stub Source"; end
|
5
|
+
def host
|
6
|
+
"http://nowhe.re"
|
7
|
+
end
|
8
|
+
|
9
|
+
def fetch(name)
|
10
|
+
available_releases[name.tr('/', '-')].values
|
11
|
+
end
|
12
|
+
|
13
|
+
def available_releases
|
14
|
+
return @available_releases if defined? @available_releases
|
15
|
+
|
16
|
+
@available_releases = {
|
17
|
+
'puppetlabs-java' => {
|
18
|
+
'10.0.0' => { 'puppetlabs/stdlib' => '4.1.0' },
|
19
|
+
},
|
20
|
+
'puppetlabs-stdlib' => {
|
21
|
+
'4.1.0' => {},
|
22
|
+
},
|
23
|
+
'pmtacceptance-stdlib' => {
|
24
|
+
"4.1.0" => {},
|
25
|
+
"3.2.0" => {},
|
26
|
+
"3.1.0" => {},
|
27
|
+
"3.0.0" => {},
|
28
|
+
"2.6.0" => {},
|
29
|
+
"2.5.1" => {},
|
30
|
+
"2.5.0" => {},
|
31
|
+
"2.4.0" => {},
|
32
|
+
"2.3.2" => {},
|
33
|
+
"2.3.1" => {},
|
34
|
+
"2.3.0" => {},
|
35
|
+
"2.2.1" => {},
|
36
|
+
"2.2.0" => {},
|
37
|
+
"2.1.3" => {},
|
38
|
+
"2.0.0" => {},
|
39
|
+
"1.1.0" => {},
|
40
|
+
"1.0.0" => {},
|
41
|
+
},
|
42
|
+
'pmtacceptance-keystone' => {
|
43
|
+
'3.0.0-rc2' => { "pmtacceptance/mysql" => ">=0.6.1 <1.0.0", "pmtacceptance/stdlib" => ">= 2.5.0" },
|
44
|
+
'3.0.0-rc1' => { "pmtacceptance/mysql" => ">=0.6.1 <1.0.0", "pmtacceptance/stdlib" => ">= 2.5.0" },
|
45
|
+
'2.2.0' => { "pmtacceptance/mysql" => ">=0.6.1 <1.0.0", "pmtacceptance/stdlib" => ">= 2.5.0" },
|
46
|
+
'2.2.0-rc1' => { "pmtacceptance/mysql" => ">=0.6.1 <1.0.0", "pmtacceptance/stdlib" => ">= 2.5.0" },
|
47
|
+
'2.1.0' => { "pmtacceptance/mysql" => ">=0.6.1 <1.0.0", "pmtacceptance/stdlib" => ">= 2.5.0" },
|
48
|
+
'2.0.0' => { "pmtacceptance/mysql" => ">= 0.6.1" },
|
49
|
+
'1.2.0' => { "pmtacceptance/mysql" => ">= 0.5.0" },
|
50
|
+
'1.1.1' => { "pmtacceptance/mysql" => ">= 0.5.0" },
|
51
|
+
'1.1.0' => { "pmtacceptance/mysql" => ">= 0.5.0" },
|
52
|
+
'1.0.1' => { "pmtacceptance/mysql" => ">= 0.5.0" },
|
53
|
+
'1.0.0' => { "pmtacceptance/mysql" => ">= 0.5.0" },
|
54
|
+
'0.2.0' => { "pmtacceptance/mysql" => ">= 0.5.0" },
|
55
|
+
'0.1.0' => { "pmtacceptance/mysql" => ">= 0.3.0" },
|
56
|
+
},
|
57
|
+
'pmtacceptance-mysql' => {
|
58
|
+
"2.1.0" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
59
|
+
"2.0.1" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
60
|
+
"2.0.0" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
61
|
+
"2.0.0-rc5" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
62
|
+
"2.0.0-rc4" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
63
|
+
"2.0.0-rc3" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
64
|
+
"2.0.0-rc2" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
65
|
+
"2.0.0-rc1" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
66
|
+
"1.0.0" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
67
|
+
"0.9.0" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
68
|
+
"0.8.1" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
69
|
+
"0.8.0" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
70
|
+
"0.7.1" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
71
|
+
"0.7.0" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
72
|
+
"0.6.1" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
73
|
+
"0.6.0" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
74
|
+
"0.5.0" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
75
|
+
"0.4.0" => {},
|
76
|
+
"0.3.0" => {},
|
77
|
+
"0.2.0" => {},
|
78
|
+
},
|
79
|
+
'pmtacceptance-apache' => {
|
80
|
+
"0.10.0" => { "pmtacceptance/stdlib" => ">= 2.4.0" },
|
81
|
+
"0.9.0" => { "pmtacceptance/stdlib" => ">= 2.4.0" },
|
82
|
+
"0.8.1" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
83
|
+
"0.8.0" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
84
|
+
"0.7.0" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
85
|
+
"0.6.0" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
86
|
+
"0.5.0-rc1" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
87
|
+
"0.4.0" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
88
|
+
"0.3.0" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
89
|
+
"0.2.2" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
90
|
+
"0.2.1" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
91
|
+
"0.2.0" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
92
|
+
"0.1.1" => { "pmtacceptance/stdlib" => ">= 2.2.1" },
|
93
|
+
"0.0.4" => {},
|
94
|
+
"0.0.3" => {},
|
95
|
+
"0.0.2" => {},
|
96
|
+
"0.0.1" => {},
|
97
|
+
},
|
98
|
+
'pmtacceptance-bacula' => {
|
99
|
+
"0.0.3" => { "pmtacceptance/stdlib" => ">= 2.2.0", "pmtacceptance/mysql" => ">= 1.0.0" },
|
100
|
+
"0.0.2" => { "pmtacceptance/stdlib" => ">= 2.2.0", "pmtacceptance/mysql" => ">= 0.0.1" },
|
101
|
+
"0.0.1" => { "pmtacceptance/stdlib" => ">= 2.2.0" },
|
102
|
+
},
|
103
|
+
}
|
104
|
+
|
105
|
+
@available_releases.each do |name, versions|
|
106
|
+
versions.each do |version, deps|
|
107
|
+
deps, metadata = deps.partition { |k,v| k.is_a? String }
|
108
|
+
dependencies = Hash[deps.map { |k, v| [ k.tr('/', '-'), v ] }]
|
109
|
+
|
110
|
+
versions[version] = create_release(name, version, dependencies).tap do |release|
|
111
|
+
release.meta_def(:prepare) { }
|
112
|
+
release.meta_def(:install) { |x| @install_dir = x.to_s }
|
113
|
+
release.meta_def(:install_dir) { @install_dir }
|
114
|
+
release.meta_def(:metadata) do
|
115
|
+
metadata = Hash[metadata].merge(
|
116
|
+
:name => name,
|
117
|
+
:version => version,
|
118
|
+
:source => '', # GRR, Puppet!
|
119
|
+
:author => '', # GRR, Puppet!
|
120
|
+
:license => '', # GRR, Puppet!
|
121
|
+
:dependencies => dependencies.map do |dep, range|
|
122
|
+
{ :name => dep, :version_requirement => range }
|
123
|
+
end
|
124
|
+
)
|
125
|
+
Hash[metadata.map { |k,v| [ k.to_s, v ] }]
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|