Initial kilo updates

* minor cleanup to spec for rubocop

Change-Id: I7406b7ac8d709e8de3c252467e1ea37e107b94e0
Partial-Bug: #1426424
This commit is contained in:
Mark Vanderwiel 2015-03-02 13:43:43 -06:00
parent 591c8773d2
commit e08c83c2e9
7 changed files with 51 additions and 40 deletions

2
.gitignore vendored
View File

@ -5,5 +5,5 @@ berks-cookbooks/
.coverage/
*.swp
Berksfile.lock
Gemfile.lock
Vagrantfile
Gemfile.lock

View File

@ -1,5 +1,7 @@
inherit_from: .rubocop_todo.yml
AllCops:
Includes:
Include:
- metadata.rb
- Gemfile
- attributes/**
@ -8,12 +10,15 @@ AllCops:
- recipes/**
- resources/**
- spec/**
Exclude:
- .cookbooks/**/*
- berks-cookbooks/**/*
- .bundle/**/*
Encoding:
Exclude:
- metadata.rb
- Gemfile
- berks-cookbooks/**
NumericLiterals:
Enabled: false

22
.rubocop_todo.yml Normal file
View File

@ -0,0 +1,22 @@
# This configuration was generated by `rubocop --auto-gen-config`
# on 2015-03-02 13:36:04 -0600 using RuboCop version 0.28.0.
# 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: 5
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/ClassAndModuleChildren:
Enabled: false
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: PreferredDelimiters.
Style/PercentLiteralDelimiters:
Enabled: false
# Offense count: 15
# Cop supports --auto-correct.
Style/SingleSpaceBeforeFirstArg:
Enabled: false

View File

@ -1,4 +1,4 @@
source "https://supermarket.getchef.com"
source "https://supermarket.chef.io"
metadata

View File

@ -1,11 +1,10 @@
source 'https://rubygems.org'
gem 'chef', '~> 11.16.0'
gem 'chef', '~> 11.18.6'
gem 'json', '<= 1.7.7' # chef 11 dependency
gem 'berkshelf', '~> 3.1.5'
gem 'berkshelf', '~> 3.2.1'
gem 'hashie', '~> 2.0'
gem 'chefspec', '~> 4.0.0'
gem 'rspec', '~> 3.0.0'
gem 'fauxhai', '>= 2.1.0'
gem 'foodcritic', '~> 4.0.0'
gem 'rubocop', '~> 0.18.1'
gem 'foodcritic', '~> 4.0'
gem 'rubocop', '~> 0.29.1'

View File

@ -12,4 +12,4 @@ recipe 'openstack-bare-metal::default', 'Temp workaround to create iro
recipe 'openstack-bare-metal::identity_registration', 'Registers ironic service/user/endpoints in keystone'
recipe 'openstack-bare-metal::ironic-common', 'Defines the common pieces of repeated code from the other recipes'
depends 'openstack-common', '~> 10.0'
depends 'openstack-common', '~> 11.0.0'

View File

@ -40,16 +40,11 @@ describe 'openstack-bare-metal::ironic-common' do
let(:dir) { chef_run.directory('/etc/ironic') }
it 'should create the directory' do
expect(chef_run).to create_directory(dir.name)
end
it 'has proper owner' do
expect(dir.owner).to eq('ironic')
expect(dir.group).to eq('ironic')
end
it 'has proper modes' do
expect(sprintf('%o', dir.mode)).to eq('750')
expect(chef_run).to create_directory(dir.name).with(
user: 'ironic',
group: 'ironic',
mode: 0750
)
end
end
@ -57,16 +52,11 @@ describe 'openstack-bare-metal::ironic-common' do
let(:file) { chef_run.template('/etc/ironic/ironic.conf') }
it 'should create the ironic.conf template' do
expect(chef_run).to create_template(file.name)
end
it 'has proper owner' do
expect(file.owner).to eq('ironic')
expect(file.group).to eq('ironic')
end
it 'has proper modes' do
expect(sprintf('%o', file.mode)).to eq('640')
expect(chef_run).to create_template(file.name).with(
user: 'ironic',
group: 'ironic',
mode: 0640
)
end
end
@ -74,16 +64,11 @@ describe 'openstack-bare-metal::ironic-common' do
let(:file) { chef_run.template('/etc/ironic/rootwrap.conf') }
it 'should create the /etc/ironic/rootwrap.conf file' do
expect(chef_run).to create_template(file.name)
end
it 'has proper owner' do
expect(file.owner).to eq('root')
expect(file.group).to eq('root')
end
it 'has proper modes' do
expect(sprintf('%o', file.mode)).to eq('644')
expect(chef_run).to create_template(file.name).with(
user: 'root',
group: 'root',
mode: 0644
)
end
context 'template contents' do