diff --git a/attributes/default.rb b/attributes/default.rb index 3b931cd..3fcde68 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,5 +1,5 @@ default['packman']['checksums'] = { - '1.1.0' => 'bd1eddfa114f7e6258ef3419613380297f1b4e438f5bae92f1177150519be934' + '1.1.0' => 'bd1eddfa114f7e6258ef3419613380297f1b4e438f5bae92f1177150519be934', } default['packman']['version'] = '1.1.0' default['packman']['bin_dir'] = '/usr/local/bin' diff --git a/libraries/helpers.rb b/libraries/helpers.rb index 35d8d81..4d1db1e 100644 --- a/libraries/helpers.rb +++ b/libraries/helpers.rb @@ -74,7 +74,7 @@ def add_local_shell_provisioner(provisioner) def validate_type! return if %w(shell local-shell file).include?(new_resource.type) - Chef::Application.fatal!("Invalid Packman type: '#{new_resource.type}' declared") + raise("Invalid Packman type: '#{new_resource.type}' declared") end def render_template(template_source, template_variables) diff --git a/libraries/packer_builder_provider.rb b/libraries/packer_builder_provider.rb index 3373908..c53cc55 100644 --- a/libraries/packer_builder_provider.rb +++ b/libraries/packer_builder_provider.rb @@ -1,6 +1,6 @@ # # Author:: Partner Engineering -# Copyright (c) 2016, Chef Software, Inc. +# Copyright:: (c) 2016, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,12 +23,6 @@ class PackerBuilder < Chef::Provider::LWRPBase include PackmanCookbook::Helpers - use_inline_resources - - def whyrun_supported? - true - end - action :create do add_builder(new_resource.name, new_resource.options) end diff --git a/libraries/packer_builder_resource.rb b/libraries/packer_builder_resource.rb index 3e41a12..ff959fc 100644 --- a/libraries/packer_builder_resource.rb +++ b/libraries/packer_builder_resource.rb @@ -1,6 +1,6 @@ # # Author:: Partner Engineering -# Copyright (c) 2016, Chef Software, Inc. +# Copyright:: (c) 2016, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ class Chef class Resource class PackerBuilder < Chef::Resource::LWRPBase resource_name :packer_builder + provides :packer_builder actions :create default_action :create diff --git a/libraries/packer_post_processor_provider.rb b/libraries/packer_post_processor_provider.rb index 0c6fe7e..2ca00b7 100644 --- a/libraries/packer_post_processor_provider.rb +++ b/libraries/packer_post_processor_provider.rb @@ -1,6 +1,6 @@ # # Author:: Partner Engineering -# Copyright (c) 2016, Chef Software, Inc. +# Copyright:: (c) 2016, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,12 +23,6 @@ class PackerPostProcessor < Chef::Provider::LWRPBase include PackmanCookbook::Helpers - use_inline_resources - - def whyrun_supported? - true - end - action :create do add_post_processor(new_resource.type, new_resource.options) end diff --git a/libraries/packer_post_processor_resource.rb b/libraries/packer_post_processor_resource.rb index f0e78a7..ea49c3c 100644 --- a/libraries/packer_post_processor_resource.rb +++ b/libraries/packer_post_processor_resource.rb @@ -1,6 +1,6 @@ # # Author:: Partner Engineering -# Copyright (c) 2016, Chef Software, Inc. +# Copyright:: (c) 2016, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ class Chef class Resource class PackerPostProcessor < Chef::Resource::LWRPBase resource_name :packer_post_processor + provides :packer_post_processor actions :create default_action :create diff --git a/libraries/packer_provisioner_provider.rb b/libraries/packer_provisioner_provider.rb index 250a47d..b9d2aa9 100644 --- a/libraries/packer_provisioner_provider.rb +++ b/libraries/packer_provisioner_provider.rb @@ -1,6 +1,6 @@ # # Author:: Partner Engineering -# Copyright (c) 2016, Chef Software, Inc. +# Copyright:: (c) 2016, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,12 +23,6 @@ class PackerProvisioner < Chef::Provider::LWRPBase include PackmanCookbook::Helpers - use_inline_resources - - def whyrun_supported? - true - end - action :create do add_provisioner end diff --git a/libraries/packer_provisioner_resource.rb b/libraries/packer_provisioner_resource.rb index cbb425f..c138306 100644 --- a/libraries/packer_provisioner_resource.rb +++ b/libraries/packer_provisioner_resource.rb @@ -1,6 +1,6 @@ # # Author:: Partner Engineering -# Copyright (c) 2016, Chef Software, Inc. +# Copyright:: (c) 2016, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ class Chef class Resource class PackerProvisioner < Chef::Resource::LWRPBase resource_name :packer_provisioner + provides :packer_provisioner actions :create default_action :create diff --git a/libraries/packer_template_provider.rb b/libraries/packer_template_provider.rb index 8837be7..45e0ad7 100644 --- a/libraries/packer_template_provider.rb +++ b/libraries/packer_template_provider.rb @@ -1,6 +1,6 @@ # # Author:: Partner Engineering -# Copyright (c) 2016, Chef Software, Inc. +# Copyright:: (c) 2016, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,12 +23,6 @@ class PackerTemplate < Chef::Provider::LWRPBase include PackmanCookbook::Helpers - use_inline_resources - - def whyrun_supported? - true - end - action :create do create_packer_template run_packer diff --git a/libraries/packer_template_resource.rb b/libraries/packer_template_resource.rb index 8124c18..664758c 100644 --- a/libraries/packer_template_resource.rb +++ b/libraries/packer_template_resource.rb @@ -1,6 +1,6 @@ # # Author:: Partner Engineering -# Copyright (c) 2016, Chef Software, Inc. +# Copyright:: (c) 2016, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ class Chef class Resource class PackerTemplate < Chef::Resource::LWRPBase resource_name :packer_template + provides :packer_template actions :create, :run default_action :create diff --git a/libraries/packer_variable_provider.rb b/libraries/packer_variable_provider.rb index 089b65c..10a1525 100644 --- a/libraries/packer_variable_provider.rb +++ b/libraries/packer_variable_provider.rb @@ -1,6 +1,6 @@ # # Author:: Partner Engineering -# Copyright (c) 2016, Chef Software, Inc. +# Copyright:: (c) 2016, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,12 +24,6 @@ class PackerVariable < Chef::Provider::LWRPBase include PackmanCookbook::Helpers - use_inline_resources - - def whyrun_supported? - true - end - action :create do add_variable(new_resource.key, new_resource.value) end diff --git a/libraries/packer_variable_resource.rb b/libraries/packer_variable_resource.rb index b33200b..8970a87 100644 --- a/libraries/packer_variable_resource.rb +++ b/libraries/packer_variable_resource.rb @@ -1,6 +1,6 @@ # # Author:: Partner Engineering -# Copyright (c) 2016, Chef Software, Inc. +# Copyright:: (c) 2016, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ class Chef class Resource class PackerVariable < Chef::Resource::LWRPBase resource_name :packer_variable + provides :packer_variable actions :create default_action :create diff --git a/metadata.rb b/metadata.rb index dda4c07..1f290a8 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,7 +1,6 @@ name 'packman' maintainer 'The Authors' maintainer_email 'you@example.com' -license 'all_rights' +license 'all rights reserved' description 'Installs/Configures packman' -long_description 'Installs/Configures packman' version '0.2.0' diff --git a/recipes/default.rb b/recipes/default.rb index bc573f7..375df80 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -1,7 +1,7 @@ # -# Cookbook Name:: packman +# Cookbook:: packman # Recipe:: default # -# Copyright (c) 2016 The Authors, All Rights Reserved. +# Copyright:: (c) 2016 The Authors, All Rights Reserved. include_recipe 'packman::_packer_install' diff --git a/spec/unit/recipes/default_spec.rb b/spec/unit/recipes/default_spec.rb index 5dff71c..fc5ba6f 100644 --- a/spec/unit/recipes/default_spec.rb +++ b/spec/unit/recipes/default_spec.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: packman +# Cookbook:: packman # Spec:: default # -# Copyright (c) 2016 The Authors, All Rights Reserved. +# Copyright:: (c) 2016 The Authors, All Rights Reserved. require 'spec_helper' diff --git a/test/fixtures/cookbooks/test/recipes/default.rb b/test/fixtures/cookbooks/test/recipes/default.rb index 1f1ef8b..06ce197 100644 --- a/test/fixtures/cookbooks/test/recipes/default.rb +++ b/test/fixtures/cookbooks/test/recipes/default.rb @@ -1,4 +1,4 @@ -include_recipe "packman::default" +include_recipe 'packman::default' packer_builder 'azure_test' do options( @@ -11,7 +11,7 @@ 'client_secret' => 'P@ssw0rd!', 'subscription_id' => '1C2B75C1-74A5-472A-A729-7F8CEFC477F9', 'resource_group_name' => 'myResourceGroup', - 'image_publisher'=> 'Canonical', + 'image_publisher' => 'Canonical', 'image_offer' => 'UbuntuServer', 'image_sku' => '14.04.5-LTS', 'storage_account' => 'myimages',