diff --git a/.rubocop.yml b/.rubocop.yml index 70ac649..7577bf4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,4 @@ +inherit_from: .rubocop_todo.yml AllCops: Include: - metadata.rb @@ -28,4 +29,4 @@ WordArray: MinSize: 3 MethodLength: - Max: 15 \ No newline at end of file + Max: 15 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..d4218c6 --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,10 @@ +# This configuration was generated by `rubocop --auto-gen-config` +# on 2015-08-31 10:13:18 -0500 using RuboCop version 0.32.1. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 1 +Metrics/AbcSize: + Max: 22 diff --git a/libraries/nova.rb b/libraries/nova.rb index 3323668..2a02243 100644 --- a/libraries/nova.rb +++ b/libraries/nova.rb @@ -22,14 +22,14 @@ module Openstack module Nova include Openstack::Client - def nova # rubocop:disable all + def nova @nova ||= Fog::Compute.new(provider: 'openstack', openstack_username: new_resource.openstack_username, openstack_api_key: new_resource.openstack_password, openstack_auth_url: new_resource.openstack_auth_url, openstack_tenant: new_resource.openstack_tenant, openstack_region: new_resource.openstack_region - ) # rubocop:disable all + ) end end end diff --git a/libraries/swift.rb b/libraries/swift.rb index 6d4a408..5929cae 100644 --- a/libraries/swift.rb +++ b/libraries/swift.rb @@ -22,7 +22,7 @@ module Openstack module Swift include Openstack::Client - def swift # rubocop:disable all + def swift @swift ||= Fog::Storage.new(provider: 'openstack', openstack_username: new_resource.openstack_username, openstack_api_key: new_resource.openstack_password, @@ -34,7 +34,7 @@ module Openstack openstack_service_name: new_resource.openstack_service_name, openstack_service_type: new_resource.openstack_service_type, openstack_endpoint_type: new_resource.openstack_endpoint_type - ) # rubocop:disable all + ) end end end diff --git a/metadata.rb b/metadata.rb index bb1232d..05ccf51 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,11 +1,11 @@ # Encoding: utf-8 name 'openstack_client' maintainer 'openstack-chef' -maintainer_email 'opscode-chef-openstack@googlegroups.com' +maintainer_email 'openstack-dev@lists.openstack.org' license 'Apache2' -description 'Library cookbook to interact with Openstack Clouds' +description 'Library cookbook to interact with OpenStack Clouds' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '11.0.0' +version '12.0.0' supports 'ubuntu', '>= 14.04' supports 'centos', '>= 6.5' diff --git a/spec/_example_nova_spec.rb b/spec/_example_nova_spec.rb index d7f5dd7..ea1d055 100644 --- a/spec/_example_nova_spec.rb +++ b/spec/_example_nova_spec.rb @@ -9,10 +9,7 @@ describe 'openstack_client::_example_nova' do it 'spins up a test machine' do expect(chef_run).to create_openstack_client_nova_server( - 'test1' - ).with( - action: [:create] - ) + 'test1').with(action: [:create]) end end @@ -23,10 +20,7 @@ describe 'openstack_client::_example_nova' do it 'deletes a test machine' do expect(chef_run).to delete_openstack_client_nova_server( - 'test' - ).with( - action: [:delete] - ) + 'test').with(action: [:delete]) end end