Merge "Fixes for Ocata, style and lint fixes for chefdk"
This commit is contained in:
commit
3cdb3b94d4
|
@ -1,11 +1,16 @@
|
|||
# This configuration was generated by
|
||||
# `rubocop --auto-gen-config`
|
||||
# on 2017-02-23 16:58:33 +0100 using RuboCop version 0.39.0.
|
||||
# on 2017-08-01 10:43:38 -0400 using RuboCop version 0.47.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: 42
|
||||
# Configuration parameters: CountComments, ExcludedMethods.
|
||||
Metrics/BlockLength:
|
||||
Max: 122
|
||||
|
||||
# Offense count: 9
|
||||
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
||||
# SupportedStyles: nested, compact
|
||||
|
|
17
metadata.rb
17
metadata.rb
|
@ -1,13 +1,10 @@
|
|||
# Encoding: utf-8
|
||||
name 'openstack-network'
|
||||
maintainer 'openstack-chef'
|
||||
name 'openstack-network'
|
||||
maintainer 'openstack-chef'
|
||||
maintainer_email 'openstack-dev@lists.openstack.org'
|
||||
issues_url 'https://launchpad.net/openstack-chef' if respond_to?(:issues_url)
|
||||
source_url 'https://github.com/openstack/cookbook-openstack-network' if respond_to?(:source_url)
|
||||
license 'Apache 2.0'
|
||||
description 'Installs and configures the OpenStack Network API Service and various agents and plugins'
|
||||
license 'Apache 2.0'
|
||||
description 'Installs and configures the OpenStack Network API Service and various agents and plugins'
|
||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||
version '15.0.0'
|
||||
version '15.0.0'
|
||||
|
||||
%w(ubuntu redhat centos).each do |os|
|
||||
supports os
|
||||
|
@ -16,3 +13,7 @@ end
|
|||
depends 'openstack-common', '>= 15.0.0'
|
||||
depends 'openstack-identity', '>= 15.0.0'
|
||||
depends 'openstackclient'
|
||||
|
||||
issues_url 'https://launchpad.net/openstack-chef' if respond_to?(:issues_url)
|
||||
source_url 'https://github.com/openstack/cookbook-openstack-network' if respond_to?(:source_url)
|
||||
chef_version '>= 12.5' if respond_to?(:chef_version)
|
||||
|
|
|
@ -23,9 +23,9 @@ timeout = node['openstack']['network']['dbsync_timeout']
|
|||
# The node['openstack']['network']['plugin_config_file'] attribute is set in the default.rb recipe
|
||||
bash 'migrate network database' do
|
||||
timeout timeout
|
||||
migrate_command = "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file #{plugin_config_file}"
|
||||
migrate_command = 'neutron-db-manage --config-file /etc/neutron/neutron.conf'
|
||||
code <<-EOF
|
||||
#{migrate_command} upgrade head
|
||||
#{migrate_command} upgrade heads
|
||||
EOF
|
||||
end
|
||||
|
||||
|
@ -35,7 +35,7 @@ bash 'migrate vpnaas database' do
|
|||
timeout timeout
|
||||
migrate_command = "neutron-db-manage --subproject neutron-vpnaas --config-file /etc/neutron/neutron.conf --config-file #{plugin_config_file}"
|
||||
code <<-EOF
|
||||
#{migrate_command} upgrade head
|
||||
#{migrate_command} upgrade heads
|
||||
EOF
|
||||
end
|
||||
|
||||
|
@ -45,7 +45,7 @@ bash 'migrate fwaas database' do
|
|||
timeout timeout
|
||||
migrate_command = "neutron-db-manage --subproject neutron-fwaas --config-file /etc/neutron/neutron.conf --config-file #{plugin_config_file}"
|
||||
code <<-EOF
|
||||
#{migrate_command} upgrade head
|
||||
#{migrate_command} upgrade heads
|
||||
EOF
|
||||
end
|
||||
|
||||
|
@ -55,6 +55,6 @@ bash 'migrate lbaas database' do
|
|||
timeout timeout
|
||||
migrate_command = "neutron-db-manage --subproject neutron-lbaas --config-file /etc/neutron/neutron.conf --config-file #{plugin_config_file}"
|
||||
code <<-EOF
|
||||
#{migrate_command} upgrade head
|
||||
#{migrate_command} upgrade heads
|
||||
EOF
|
||||
end
|
||||
|
|
|
@ -51,14 +51,14 @@ end
|
|||
directory '/var/cache/neutron' do
|
||||
owner node['openstack']['network']['platform']['user']
|
||||
group node['openstack']['network']['platform']['group']
|
||||
mode 00700
|
||||
mode 0o0700
|
||||
action :create
|
||||
end
|
||||
|
||||
directory node['openstack']['network']['api']['auth']['cache_dir'] do
|
||||
owner node['openstack']['network']['platform']['user']
|
||||
group node['openstack']['network']['platform']['group']
|
||||
mode 00700
|
||||
mode 0o0700
|
||||
only_if { node['openstack']['auth']['strategy'] == 'pki' }
|
||||
end
|
||||
|
||||
|
@ -67,7 +67,7 @@ template '/etc/neutron/rootwrap.conf' do
|
|||
cookbook 'openstack-common'
|
||||
owner node['openstack']['network']['platform']['user']
|
||||
group node['openstack']['network']['platform']['group']
|
||||
mode 00644
|
||||
mode 0o0644
|
||||
variables(
|
||||
service_config: node['openstack']['network']['rootwrap']['conf']
|
||||
)
|
||||
|
@ -124,7 +124,7 @@ template '/etc/neutron/neutron.conf' do
|
|||
cookbook 'openstack-common'
|
||||
owner node['openstack']['network']['platform']['user']
|
||||
group node['openstack']['network']['platform']['group']
|
||||
mode 00640
|
||||
mode 0o0640
|
||||
variables(
|
||||
service_config: neutron_conf_options
|
||||
)
|
||||
|
|
|
@ -35,7 +35,7 @@ template '/etc/neutron/dnsmasq.conf' do
|
|||
source 'dnsmasq.conf.erb'
|
||||
owner node['openstack']['network']['platform']['user']
|
||||
group node['openstack']['network']['platform']['group']
|
||||
mode 00644
|
||||
mode 0o0644
|
||||
end
|
||||
|
||||
service_config = merge_config_options 'network_dhcp'
|
||||
|
@ -44,7 +44,7 @@ template node['openstack']['network_dhcp']['config_file'] do
|
|||
cookbook 'openstack-common'
|
||||
owner node['openstack']['network']['platform']['user']
|
||||
group node['openstack']['network']['platform']['group']
|
||||
mode 00644
|
||||
mode 0o0644
|
||||
variables(
|
||||
service_config: service_config
|
||||
)
|
||||
|
|
|
@ -33,7 +33,7 @@ template node['openstack']['network_fwaas']['config_file'] do
|
|||
cookbook 'openstack-common'
|
||||
owner node['openstack']['network']['platform']['user']
|
||||
group node['openstack']['network']['platform']['group']
|
||||
mode 00640
|
||||
mode 0o0640
|
||||
variables(
|
||||
service_config: service_conf
|
||||
)
|
||||
|
|
|
@ -40,7 +40,7 @@ template node['openstack']['network_l3']['config_file'] do
|
|||
cookbook 'openstack-common'
|
||||
owner node['openstack']['network']['platform']['user']
|
||||
group node['openstack']['network']['platform']['group']
|
||||
mode 00640
|
||||
mode 0o0640
|
||||
variables(
|
||||
service_config: service_config
|
||||
)
|
||||
|
|
|
@ -42,7 +42,7 @@ template node['openstack']['network_lbaas']['config_file'] do
|
|||
cookbook 'openstack-common'
|
||||
owner node['openstack']['network']['platform']['user']
|
||||
group node['openstack']['network']['platform']['group']
|
||||
mode 00640
|
||||
mode 0o0640
|
||||
variables(
|
||||
service_config: service_config
|
||||
)
|
||||
|
|
|
@ -43,7 +43,7 @@ template node['openstack']['network_metadata']['config_file'] do
|
|||
cookbook 'openstack-common'
|
||||
owner node['openstack']['network']['platform']['user']
|
||||
group node['openstack']['network']['platform']['group']
|
||||
mode 00644
|
||||
mode 0o0644
|
||||
variables(
|
||||
service_config: service_config
|
||||
)
|
||||
|
|
|
@ -33,7 +33,7 @@ template node['openstack']['network_metering']['config_file'] do
|
|||
cookbook 'openstack-common'
|
||||
owner node['openstack']['network']['platform']['user']
|
||||
group node['openstack']['network']['platform']['group']
|
||||
mode 00640
|
||||
mode 0o0640
|
||||
variables(
|
||||
service_config: service_config
|
||||
)
|
||||
|
|
|
@ -25,7 +25,9 @@
|
|||
# proper directory when including the plugin_conf recipe in this cookbook. The
|
||||
# config can be filled via attributes (e.g. like done for the ml2_openvswitch).
|
||||
include_recipe 'openstack-network'
|
||||
node.default['openstack']['network']['plugins']['ml2']['conf']['ml2']['mechanism_drivers'] = 'linuxbridge'
|
||||
node.default['openstack']['network']['plugins']['ml2']['conf']['ml2']['type_drivers'] = 'local,flat,vlan,gre,vxlan'
|
||||
node.default['openstack']['network']['plugins']['ml2']['conf']['ml2']['mechanism_drivers'] = 'linuxbridge,l2population'
|
||||
node.default['openstack']['network']['plugins']['ml2']['conf']['ml2_type_vxlan']['vni_ranges'] = 'VNI_START:VNI_END'
|
||||
|
||||
platform_options = node['openstack']['network']['platform']
|
||||
platform_options['neutron_linuxbridge_agent_packages'].each do |pkg|
|
||||
|
|
|
@ -22,7 +22,7 @@ node['openstack']['network']['plugins'].each_value do |plugin|
|
|||
recursive true
|
||||
owner node['openstack']['network']['platform']['user']
|
||||
group node['openstack']['network']['platform']['group']
|
||||
mode 00700
|
||||
mode 0o0700
|
||||
end
|
||||
|
||||
template File.join(plugin['path'], plugin['filename']) do
|
||||
|
@ -30,7 +30,7 @@ node['openstack']['network']['plugins'].each_value do |plugin|
|
|||
cookbook 'openstack-common'
|
||||
owner node['openstack']['network']['platform']['user']
|
||||
group node['openstack']['network']['platform']['group']
|
||||
mode 00644
|
||||
mode 0o0644
|
||||
variables(
|
||||
service_config: plugin['conf']
|
||||
)
|
||||
|
|
|
@ -30,7 +30,7 @@ template '/etc/default/neutron-server' do
|
|||
source 'neutron-server.erb'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode 00644
|
||||
mode 0o0644
|
||||
variables(
|
||||
core_plugin_config: node['openstack']['network']['core_plugin_config_file']
|
||||
)
|
||||
|
@ -59,7 +59,7 @@ if node['openstack']['network']['policyfile_url']
|
|||
source node['openstack']['network']['policyfile_url']
|
||||
owner node['openstack']['network']['platform']['user']
|
||||
group node['openstack']['network']['platform']['group']
|
||||
mode 00644
|
||||
mode 0o0644
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -92,7 +92,7 @@ end
|
|||
# Migrate network database to latest version
|
||||
include_recipe 'openstack-network::db_migration'
|
||||
plugin_templates = []
|
||||
node['openstack']['network']['plugins'].each_value do |plugin|
|
||||
node['openstack']['network']['plugins'].each_value.to_s do |plugin|
|
||||
plugin_templates << "template[#{File.join(plugin['path'], plugin['filename'])}]"
|
||||
end
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ template node['openstack']['network_vpnaas']['config_file'] do
|
|||
cookbook 'openstack-common'
|
||||
owner node['openstack']['network']['platform']['user']
|
||||
group node['openstack']['network']['platform']['group']
|
||||
mode 00640
|
||||
mode 0o0640
|
||||
variables(
|
||||
service_config: service_conf
|
||||
)
|
||||
|
|
|
@ -21,7 +21,7 @@ describe 'openstack-network' do
|
|||
expect(chef_run).to create_directory('/var/cache/neutron')
|
||||
.with(owner: 'neutron',
|
||||
group: 'neutron',
|
||||
mode: 00700)
|
||||
mode: 0o0700)
|
||||
end
|
||||
|
||||
describe '/var/cache/neutron/api with pki set' do
|
||||
|
@ -32,7 +32,7 @@ describe 'openstack-network' do
|
|||
expect(chef_run).to create_directory('/var/cache/neutron/api')
|
||||
.with(owner: 'neutron',
|
||||
group: 'neutron',
|
||||
mode: 00700)
|
||||
mode: 0o0700)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -44,7 +44,7 @@ describe 'openstack-network' do
|
|||
expect(chef_run).not_to create_directory('/var/cache/neutron/api')
|
||||
.with(owner: 'neutron',
|
||||
group: 'neutron',
|
||||
mode: 00700)
|
||||
mode: 0o0700)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -116,7 +116,7 @@ describe 'openstack-network' do
|
|||
end
|
||||
end
|
||||
[
|
||||
%r{^connection = mysql://neutron:neutron@127\.0\.0\.1:3306/neutron\?charset=utf8$}
|
||||
%(connection = mysql+pymysql://neutron:neutron@127.0.0.1:3306/neutron?charset=utf8)
|
||||
].each do |line|
|
||||
it do
|
||||
expect(chef_run).to render_config_file(file.name)
|
||||
|
|
|
@ -42,7 +42,7 @@ describe 'openstack-network::dhcp_agent' do
|
|||
expect(chef_run).to create_template(file.name).with(
|
||||
user: 'neutron',
|
||||
group: 'neutron',
|
||||
mode: 0644
|
||||
mode: 0o644
|
||||
)
|
||||
end
|
||||
end
|
||||
|
@ -54,7 +54,7 @@ describe 'openstack-network::dhcp_agent' do
|
|||
expect(chef_run).to create_template(file.name).with(
|
||||
user: 'neutron',
|
||||
group: 'neutron',
|
||||
mode: 0644
|
||||
mode: 0o644
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -33,7 +33,7 @@ describe 'openstack-network::dhcp_agent' do
|
|||
expect(chef_run).to create_template(file.name).with(
|
||||
user: 'neutron',
|
||||
group: 'neutron',
|
||||
mode: 0644
|
||||
mode: 0o644
|
||||
)
|
||||
end
|
||||
end
|
||||
|
@ -44,7 +44,7 @@ describe 'openstack-network::dhcp_agent' do
|
|||
expect(chef_run).to create_template(file.name).with(
|
||||
user: 'neutron',
|
||||
group: 'neutron',
|
||||
mode: 0644
|
||||
mode: 0o644
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -33,7 +33,7 @@ describe 'openstack-network::l3_agent' do
|
|||
expect(chef_run).to create_template(file.name).with(
|
||||
user: 'neutron',
|
||||
group: 'neutron',
|
||||
mode: 0640
|
||||
mode: 0o640
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ describe 'openstack-network::lbaas' do
|
|||
expect(chef_run).to create_template(file.name).with(
|
||||
user: 'neutron',
|
||||
group: 'neutron',
|
||||
mode: 0640
|
||||
mode: 0o640
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ describe 'openstack-network::lbaas' do
|
|||
expect(chef_run).to create_template(file.name).with(
|
||||
user: 'neutron',
|
||||
group: 'neutron',
|
||||
mode: 00640
|
||||
mode: 0o0640
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ describe 'openstack-network::metadata_agent' do
|
|||
expect(chef_run).to create_template(file.name).with(
|
||||
user: 'neutron',
|
||||
group: 'neutron',
|
||||
mode: 0644
|
||||
mode: 0o644
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ describe 'openstack-network::metering_agent' do
|
|||
expect(chef_run).to create_template(file.name).with(
|
||||
user: 'neutron',
|
||||
group: 'neutron',
|
||||
mode: 00640
|
||||
mode: 0o0640
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ describe 'openstack-network::ml2_linuxbridge' do
|
|||
expect(chef_run).to create_directory('/etc/neutron/plugins/ml2').with(
|
||||
owner: 'neutron',
|
||||
group: 'neutron',
|
||||
mode: 0700
|
||||
mode: 0o700
|
||||
)
|
||||
end
|
||||
it do
|
||||
|
|
|
@ -26,7 +26,7 @@ describe 'openstack-network::ml2_linuxbridge' do
|
|||
expect(chef_run).to create_directory('/etc/neutron/plugins/linuxbridge').with(
|
||||
owner: 'neutron',
|
||||
group: 'neutron',
|
||||
mode: 0700
|
||||
mode: 0o700
|
||||
)
|
||||
end
|
||||
it do
|
||||
|
|
|
@ -30,7 +30,7 @@ describe 'openstack-network::plugin_config' do
|
|||
recursive: true,
|
||||
owner: 'neutron',
|
||||
group: 'neutron',
|
||||
mode: 00700
|
||||
mode: 0o0700
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -54,7 +54,8 @@ describe 'openstack-network::server' do
|
|||
node.set['openstack']['network']['platform']['neutron_server_service'] = 'my-neutron-server'
|
||||
|
||||
expect(chef_run).to enable_service('neutron-server').with(
|
||||
service_name: 'my-neutron-server')
|
||||
service_name: 'my-neutron-server'
|
||||
)
|
||||
end
|
||||
|
||||
it 'allows overriding package options' do
|
||||
|
@ -78,7 +79,7 @@ describe 'openstack-network::server' do
|
|||
expect(chef_run).to create_template(file.name).with(
|
||||
user: 'root',
|
||||
group: 'root',
|
||||
mode: 0644
|
||||
mode: 0o644
|
||||
)
|
||||
end
|
||||
end
|
||||
|
@ -90,7 +91,7 @@ describe 'openstack-network::server' do
|
|||
expect(chef_run).to create_template(file.name).with(
|
||||
user: 'neutron',
|
||||
group: 'neutron',
|
||||
mode: 0644
|
||||
mode: 0o644
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ describe 'openstack-network::vpnaas' do
|
|||
expect(chef_run).to create_template(file.name).with(
|
||||
user: 'neutron',
|
||||
group: 'neutron',
|
||||
mode: 0640
|
||||
mode: 0o640
|
||||
)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue