diff --git a/Rakefile b/Rakefile index 30577ed..76c2f75 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,7 @@ # frozen_string_literal: true # # 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. diff --git a/attributes/aws.rb b/attributes/aws.rb index 53a7cd8..87ffc3c 100644 --- a/attributes/aws.rb +++ b/attributes/aws.rb @@ -3,7 +3,7 @@ credential_file = ::File.join(cred_dir, 'credentials') TIMESTAMP = Time.now.strftime('%Y_%m_%d_%H_%M_%S').freeze -INVALID_AMI_NAME_CHARACTERS = /[^\w\(\)\.\-\/]/ +INVALID_AMI_NAME_CHARACTERS = %r{[^\w\(\)\.\-/]} def normalize_name(name) # Append timestamp @@ -72,5 +72,5 @@ def normalize_name(name) 'license_type' => 'BYOL', 'free_node_count' => 10, 'product_code' => '363g20l00p8t6jcrb3z79yl3f' - ), + ), } diff --git a/attributes/azure.rb b/attributes/azure.rb index 2cc2a3c..0f733dd 100644 --- a/attributes/azure.rb +++ b/attributes/azure.rb @@ -15,7 +15,7 @@ 'free_node_count' => 5, } -creds = Chef::DataBagItem.load('marketplace_image', 'publishing_credentials') +creds = data_bag_item('marketplace_image', 'publishing_credentials') azure_builder_config = { 'name' => 'azure_automate_BYOL', diff --git a/attributes/gce.rb b/attributes/gce.rb index a6b5f0a..8f1fd76 100644 --- a/attributes/gce.rb +++ b/attributes/gce.rb @@ -25,7 +25,7 @@ 'project_id' => 'chef-marketplace-dev', 'source_image' => 'centos-7-v20160126', 'zone' => 'us-central1-a', - 'ssh_username' => 'marketplace' # required on CentOS + 'ssh_username' => 'marketplace', # required on CentOS } default['marketplace_image']['gce']['aio']['products'] = diff --git a/libraries/helpers.rb b/libraries/helpers.rb index 6d7dfbc..bc7d393 100644 --- a/libraries/helpers.rb +++ b/libraries/helpers.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # # 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. @@ -39,10 +39,10 @@ def enabled_image_names end def aws_products - [ - node['marketplace_image']['aws']['public']['automate'], - node['marketplace_image']['aws']['public_byol']['automate'] - ] + [ + node['marketplace_image']['aws']['public']['automate'], + node['marketplace_image']['aws']['public_byol']['automate'], + ] end def enabled_aws_builders @@ -68,7 +68,7 @@ def enabled_aws_image_names def azure_products [ - node['marketplace_image']['azure']['automate'] + node['marketplace_image']['azure']['automate'], ] end @@ -132,7 +132,7 @@ def use_current_repo? end end -Chef::Recipe.send(:include, MarketplaceImageCookbook::Helpers) -Chef::Provider.send(:include, MarketplaceImageCookbook::Helpers) +Chef::DSL::Recipe.send(:include, MarketplaceImageCookbook::Helpers) +Chef::DSL::Recipe.send(:include, MarketplaceImageCookbook::Helpers) Chef::Resource.send(:include, MarketplaceImageCookbook::Helpers) Chef::ResourceDefinition.send(:include, MarketplaceImageCookbook::Helpers) diff --git a/metadata.rb b/metadata.rb index d0734ef..8cc5a5a 100644 --- a/metadata.rb +++ b/metadata.rb @@ -2,9 +2,8 @@ name 'marketplace_image' maintainer 'Chef Partner Engineering' maintainer_email 'partnereng@chef.io' -license 'Apache 2.0' +license 'Apache-2.0' description 'Installs/Configures marketplace_image' -long_description 'Installs/Configures marketplace_image' version '0.5.0' chef_version '>=12.19' diff --git a/recipes/_packer.rb b/recipes/_packer.rb index 1a7e772..66dae65 100644 --- a/recipes/_packer.rb +++ b/recipes/_packer.rb @@ -1,13 +1,13 @@ # frozen_string_literal: true apt_update 'update' do action :update - only_if { node['platform_family'] == 'debian' } + only_if { platform_family?('debian') } end include_recipe 'packman::default' bash 'ulimit -n unlimited' do - not_if { node['platform_family'] == 'debian' } + not_if { platform_family?('debian') } end creds = data_bag_item('marketplace_image', 'publishing_credentials')