Initial compute Pike updates
- Switched the default linter to cookstyle - Deprecated config settings for Pike - Normalized template comment Depends-On: I7a67ba2520b8e44efec6edd8506f96b0e0dc913b Change-Id: I7abd4194bb7f322764309cad514040c1f5feca00
This commit is contained in:
parent
32c60ffe6d
commit
cbe2ef6647
|
@ -1,72 +1,13 @@
|
||||||
# This configuration was generated by
|
# This configuration was generated by
|
||||||
# `rubocop --auto-gen-config`
|
# `rubocop --auto-gen-config`
|
||||||
# on 2017-08-17 14:16:04 +0200 using RuboCop version 0.47.1.
|
# on 2017-08-25 09:18:09 -0400 using RuboCop version 0.47.1.
|
||||||
# The point is for the user to remove these configuration records
|
# The point is for the user to remove these configuration records
|
||||||
# one by one as the offenses are removed from the code base.
|
# one by one as the offenses are removed from the code base.
|
||||||
# Note that changes in the inspected code, or installation of new
|
# Note that changes in the inspected code, or installation of new
|
||||||
# versions of RuboCop, may require this file to be generated again.
|
# versions of RuboCop, may require this file to be generated again.
|
||||||
|
|
||||||
# Offense count: 1
|
|
||||||
Metrics/AbcSize:
|
|
||||||
Max: 16
|
|
||||||
|
|
||||||
# Offense count: 28
|
|
||||||
# Configuration parameters: CountComments, ExcludedMethods.
|
|
||||||
Metrics/BlockLength:
|
|
||||||
Max: 373
|
|
||||||
|
|
||||||
# Offense count: 2
|
|
||||||
# Configuration parameters: CountComments.
|
|
||||||
Metrics/MethodLength:
|
|
||||||
Max: 19
|
|
||||||
|
|
||||||
# Offense count: 8
|
|
||||||
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
||||||
# SupportedStyles: nested, compact
|
|
||||||
Style/ClassAndModuleChildren:
|
|
||||||
Exclude:
|
|
||||||
- 'recipes/api-metadata.rb'
|
|
||||||
- 'recipes/api-os-compute.rb'
|
|
||||||
- 'recipes/compute.rb'
|
|
||||||
- 'recipes/identity_registration.rb'
|
|
||||||
- 'recipes/libvirt_rbd.rb'
|
|
||||||
- 'recipes/nova-common.rb'
|
|
||||||
- 'recipes/nova-setup.rb'
|
|
||||||
- 'recipes/placement_api.rb'
|
|
||||||
|
|
||||||
# Offense count: 7
|
|
||||||
Style/Documentation:
|
|
||||||
Exclude:
|
|
||||||
- 'spec/**/*'
|
|
||||||
- 'test/**/*'
|
|
||||||
- 'recipes/api-metadata.rb'
|
|
||||||
- 'recipes/api-os-compute.rb'
|
|
||||||
- 'recipes/compute.rb'
|
|
||||||
- 'recipes/identity_registration.rb'
|
|
||||||
- 'recipes/libvirt_rbd.rb'
|
|
||||||
- 'recipes/nova-setup.rb'
|
|
||||||
- 'recipes/placement_api.rb'
|
|
||||||
|
|
||||||
# Offense count: 3
|
# Offense count: 3
|
||||||
# Configuration parameters: MinBodyLength.
|
# Configuration parameters: MinBodyLength.
|
||||||
Style/GuardClause:
|
Style/GuardClause:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'recipes/libvirt.rb'
|
- 'recipes/libvirt.rb'
|
||||||
|
|
||||||
# Offense count: 1
|
|
||||||
# Cop supports --auto-correct.
|
|
||||||
# Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles.
|
|
||||||
# SupportedStyles: skip_modifier_ifs, always
|
|
||||||
Style/Next:
|
|
||||||
Exclude:
|
|
||||||
- 'recipes/libvirt.rb'
|
|
||||||
|
|
||||||
# Offense count: 8
|
|
||||||
# Cop supports --auto-correct.
|
|
||||||
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
|
|
||||||
# SupportedStyles: single_quotes, double_quotes
|
|
||||||
Style/StringLiterals:
|
|
||||||
Exclude:
|
|
||||||
- 'spec/identity_registration_spec.rb'
|
|
||||||
- 'spec/placement_api_spec.rb'
|
|
||||||
- 'spec/spec_helper.rb'
|
|
||||||
|
|
14
Rakefile
14
Rakefile
|
@ -1,20 +1,20 @@
|
||||||
task default: ["test"]
|
task default: ["test"]
|
||||||
|
|
||||||
task :test => [:lint, :style, :unit]
|
task :test => [:syntax, :lint, :unit]
|
||||||
|
|
||||||
desc "Vendor the cookbooks in the Berksfile"
|
desc "Vendor the cookbooks in the Berksfile"
|
||||||
task :berks_prep do
|
task :berks_prep do
|
||||||
sh %{chef exec berks vendor}
|
sh %{chef exec berks vendor}
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Run FoodCritic (lint) tests"
|
desc "Run FoodCritic (syntax) tests"
|
||||||
task :lint do
|
task :syntax do
|
||||||
sh %{chef exec foodcritic --epic-fail any --tags ~FC003 --tags ~FC023 .}
|
sh %{chef exec foodcritic --exclude spec -f any .}
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Run RuboCop (style) tests"
|
desc "Run CookStyle (lint) tests"
|
||||||
task :style do
|
task :lint do
|
||||||
sh %{chef exec rubocop}
|
sh %{chef exec cookstyle}
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Run RSpec (unit) tests"
|
desc "Run RSpec (unit) tests"
|
||||||
|
|
|
@ -8,8 +8,8 @@ default['enable_monit'] = false # OS provides packages
|
||||||
# Set to some text value if you want templated config files
|
# Set to some text value if you want templated config files
|
||||||
# to contain a custom banner at the top of the written file
|
# to contain a custom banner at the top of the written file
|
||||||
default['openstack']['compute']['custom_template_banner'] = '
|
default['openstack']['compute']['custom_template_banner'] = '
|
||||||
# This file autogenerated by Chef
|
# This file is automatically generated by Chef
|
||||||
# Do not edit, changes will be overwritten
|
# Any changes will be overwritten
|
||||||
'
|
'
|
||||||
|
|
||||||
# The name of the Chef role that knows about the message queue server
|
# The name of the Chef role that knows about the message queue server
|
||||||
|
@ -92,7 +92,7 @@ default['openstack']['compute']['ratelimit']['settings'] = {
|
||||||
'create-servers-limit' => { 'verb' => 'POST', 'uri' => '*/servers', 'regex' => '^/servers', 'limit' => '50', 'interval' => 'DAY' },
|
'create-servers-limit' => { 'verb' => 'POST', 'uri' => '*/servers', 'regex' => '^/servers', 'limit' => '50', 'interval' => 'DAY' },
|
||||||
'generic-put-limit' => { 'verb' => 'PUT', 'uri' => '*', 'regex' => '.*', 'limit' => '10', 'interval' => 'MINUTE' },
|
'generic-put-limit' => { 'verb' => 'PUT', 'uri' => '*', 'regex' => '.*', 'limit' => '10', 'interval' => 'MINUTE' },
|
||||||
'changes-since-limit' => { 'verb' => 'GET', 'uri' => '*changes-since*', 'regex' => '.*changes-since.*', 'limit' => '3', 'interval' => 'MINUTE' },
|
'changes-since-limit' => { 'verb' => 'GET', 'uri' => '*changes-since*', 'regex' => '.*changes-since.*', 'limit' => '3', 'interval' => 'MINUTE' },
|
||||||
'generic-delete-limit' => { 'verb' => 'DELETE', 'uri' => '*', 'regex' => '.*', 'limit' => '100', 'interval' => 'MINUTE' }
|
'generic-delete-limit' => { 'verb' => 'DELETE', 'uri' => '*', 'regex' => '.*', 'limit' => '100', 'interval' => 'MINUTE' },
|
||||||
}
|
}
|
||||||
|
|
||||||
# Metering settings
|
# Metering settings
|
||||||
|
@ -169,7 +169,7 @@ when 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
|
||||||
'common_packages' => ['openstack-nova-common'],
|
'common_packages' => ['openstack-nova-common'],
|
||||||
'iscsi_helper' => 'ietadm',
|
'iscsi_helper' => 'ietadm',
|
||||||
'volume_packages' => ['sysfsutils', 'sg3_utils', 'device-mapper-multipath'],
|
'volume_packages' => ['sysfsutils', 'sg3_utils', 'device-mapper-multipath'],
|
||||||
'package_overrides' => ''
|
'package_overrides' => '',
|
||||||
}
|
}
|
||||||
when 'debian'
|
when 'debian'
|
||||||
default['openstack']['compute']['platform'] = {
|
default['openstack']['compute']['platform'] = {
|
||||||
|
@ -205,7 +205,7 @@ when 'debian'
|
||||||
'common_packages' => ['nova-common'],
|
'common_packages' => ['nova-common'],
|
||||||
'iscsi_helper' => 'tgtadm',
|
'iscsi_helper' => 'tgtadm',
|
||||||
'volume_packages' => ['sysfsutils', 'sg3-utils', 'multipath-tools'],
|
'volume_packages' => ['sysfsutils', 'sg3-utils', 'multipath-tools'],
|
||||||
'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'"
|
'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'",
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -13,12 +13,6 @@ default['openstack']['compute']['conf'].tap do |conf|
|
||||||
conf['DEFAULT']['log_config'] = '/etc/openstack/logging.conf'
|
conf['DEFAULT']['log_config'] = '/etc/openstack/logging.conf'
|
||||||
end
|
end
|
||||||
|
|
||||||
conf['DEFAULT']['use_neutron'] = 'true'
|
|
||||||
conf['DEFAULT']['linuxnet_interface_driver'] = 'nova.network.linux_net.LinuxOVSInterfaceDriver'
|
|
||||||
conf['DEFAULT']['firewall_driver'] = 'nova.virt.firewall.NoopFirewallDriver'
|
|
||||||
conf['DEFAULT']['default_floating_pool'] = 'public' # not listed
|
|
||||||
conf['DEFAULT']['dns_server'] = '8.8.8.8' # [] in docs
|
|
||||||
|
|
||||||
# [keystone_authtoken]
|
# [keystone_authtoken]
|
||||||
conf['keystone_authtoken']['auth_type'] = 'v3password'
|
conf['keystone_authtoken']['auth_type'] = 'v3password'
|
||||||
conf['keystone_authtoken']['region_name'] = node['openstack']['region']
|
conf['keystone_authtoken']['region_name'] = node['openstack']['region']
|
||||||
|
|
|
@ -49,6 +49,6 @@ service 'nova-api-metadata' do
|
||||||
action [:enable, :start]
|
action [:enable, :start]
|
||||||
subscribes :restart, [
|
subscribes :restart, [
|
||||||
'template[/etc/nova/nova.conf]',
|
'template[/etc/nova/nova.conf]',
|
||||||
'template[/etc/nova/api-paste.ini]'
|
'template[/etc/nova/api-paste.ini]',
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
|
@ -57,7 +57,7 @@ service 'nova-api-os-compute' do
|
||||||
action [:enable, :start]
|
action [:enable, :start]
|
||||||
subscribes :restart, [
|
subscribes :restart, [
|
||||||
'template[/etc/nova/nova.conf]',
|
'template[/etc/nova/nova.conf]',
|
||||||
'template[/etc/nova/api-paste.ini]'
|
'template[/etc/nova/api-paste.ini]',
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,6 @@ service 'nova-compute' do
|
||||||
action [:enable, :start]
|
action [:enable, :start]
|
||||||
subscribes :restart, [
|
subscribes :restart, [
|
||||||
'template[/etc/nova/nova.conf]',
|
'template[/etc/nova/nova.conf]',
|
||||||
'file[docker.filter]'
|
'file[docker.filter]',
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
|
@ -29,11 +29,11 @@ identity_admin_endpoint = admin_endpoint 'identity'
|
||||||
interfaces = {
|
interfaces = {
|
||||||
public: { url: public_endpoint('compute-api') },
|
public: { url: public_endpoint('compute-api') },
|
||||||
internal: { url: internal_endpoint('compute-api') },
|
internal: { url: internal_endpoint('compute-api') },
|
||||||
admin: { url: admin_endpoint('compute-api') }
|
admin: { url: admin_endpoint('compute-api') },
|
||||||
}
|
}
|
||||||
placement_interfaces = {
|
placement_interfaces = {
|
||||||
public: { url: public_endpoint('placement-api') },
|
public: { url: public_endpoint('placement-api') },
|
||||||
internal: { url: internal_endpoint('placement-api') }
|
internal: { url: internal_endpoint('placement-api') },
|
||||||
}
|
}
|
||||||
auth_url = ::URI.decode identity_admin_endpoint.to_s
|
auth_url = ::URI.decode identity_admin_endpoint.to_s
|
||||||
service_pass = get_password 'service', 'openstack-compute'
|
service_pass = get_password 'service', 'openstack-compute'
|
||||||
|
@ -58,7 +58,7 @@ connection_params = {
|
||||||
openstack_username: admin_user,
|
openstack_username: admin_user,
|
||||||
openstack_api_key: admin_pass,
|
openstack_api_key: admin_pass,
|
||||||
openstack_project_name: admin_project,
|
openstack_project_name: admin_project,
|
||||||
openstack_domain_name: admin_domain
|
openstack_domain_name: admin_domain,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Register Compute Services
|
# Register Compute Services
|
||||||
|
|
|
@ -40,7 +40,7 @@ def update_grub_default_kernel(flavor = 'default')
|
||||||
f.lines.each do |line|
|
f.lines.each do |line|
|
||||||
current_default = line.scan(/\d/).first.to_i if line.start_with?('default')
|
current_default = line.scan(/\d/).first.to_i if line.start_with?('default')
|
||||||
|
|
||||||
if line.start_with?('title')
|
next unless line.start_with?('title')
|
||||||
if flavor.eql?('xen')
|
if flavor.eql?('xen')
|
||||||
# found boot index
|
# found boot index
|
||||||
break if line.include?('Xen')
|
break if line.include?('Xen')
|
||||||
|
@ -52,7 +52,6 @@ def update_grub_default_kernel(flavor = 'default')
|
||||||
default_boot += 1
|
default_boot += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# change default option for /boot/grub/menu.lst
|
# change default option for /boot/grub/menu.lst
|
||||||
unless current_default.eql?(default_boot)
|
unless current_default.eql?(default_boot)
|
||||||
|
|
|
@ -15,7 +15,7 @@ describe 'openstack-compute::identity_registration' do
|
||||||
openstack_username: 'admin',
|
openstack_username: 'admin',
|
||||||
openstack_api_key: 'admin',
|
openstack_api_key: 'admin',
|
||||||
openstack_project_name: 'admin',
|
openstack_project_name: 'admin',
|
||||||
openstack_domain_name: 'default'
|
openstack_domain_name: 'default',
|
||||||
}
|
}
|
||||||
service_name = 'nova'
|
service_name = 'nova'
|
||||||
service_type = 'compute'
|
service_type = 'compute'
|
||||||
|
@ -49,7 +49,7 @@ describe 'openstack-compute::identity_registration' do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "registers placement service" do
|
it 'registers placement service' do
|
||||||
expect(chef_run).to create_openstack_service(
|
expect(chef_run).to create_openstack_service(
|
||||||
placement_service_name
|
placement_service_name
|
||||||
).with(
|
).with(
|
||||||
|
@ -74,7 +74,7 @@ describe 'openstack-compute::identity_registration' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "registers placement endpoint" do
|
context 'registers placement endpoint' do
|
||||||
%w(internal public).each do |interface|
|
%w(internal public).each do |interface|
|
||||||
it "creates #{interface} endpoint with default values" do
|
it "creates #{interface} endpoint with default values" do
|
||||||
expect(chef_run).to create_openstack_endpoint(
|
expect(chef_run).to create_openstack_endpoint(
|
||||||
|
@ -112,7 +112,7 @@ describe 'openstack-compute::identity_registration' do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
context "grants user roles" do
|
context 'grants user roles' do
|
||||||
[service_user, placement_service_user].each do |user_name|
|
[service_user, placement_service_user].each do |user_name|
|
||||||
it do
|
it do
|
||||||
expect(chef_run).to grant_domain_openstack_user(
|
expect(chef_run).to grant_domain_openstack_user(
|
||||||
|
|
|
@ -95,7 +95,7 @@ describe 'openstack-compute::libvirt' do
|
||||||
it 'template contents' do
|
it 'template contents' do
|
||||||
[
|
[
|
||||||
/^start_libvirtd="yes"$/,
|
/^start_libvirtd="yes"$/,
|
||||||
/^libvirtd_opts="-l"$/
|
/^libvirtd_opts="-l"$/,
|
||||||
].each do |line|
|
].each do |line|
|
||||||
expect(chef_run).to render_file(file.name).with_content(line)
|
expect(chef_run).to render_file(file.name).with_content(line)
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,7 +8,7 @@ describe 'openstack-compute::nova-common' do
|
||||||
let(:node) { runner.node }
|
let(:node) { runner.node }
|
||||||
let(:chef_run) do
|
let(:chef_run) do
|
||||||
node.set['openstack']['mq'] = {
|
node.set['openstack']['mq'] = {
|
||||||
'host' => '127.0.0.1'
|
'host' => '127.0.0.1',
|
||||||
}
|
}
|
||||||
node.set['openstack']['mq']['compute']['rabbit']['ha'] = true
|
node.set['openstack']['mq']['compute']['rabbit']['ha'] = true
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ describe 'openstack-compute::nova-common' do
|
||||||
'username = nova',
|
'username = nova',
|
||||||
'project_name = service',
|
'project_name = service',
|
||||||
'user_domain_name = Default',
|
'user_domain_name = Default',
|
||||||
'project_domain_name = Default'
|
'project_domain_name = Default',
|
||||||
].each do |line|
|
].each do |line|
|
||||||
expect(chef_run).to render_config_file(file.name)\
|
expect(chef_run).to render_config_file(file.name)\
|
||||||
.with_section_content('keystone_authtoken', /^#{Regexp.quote(line)}$/)
|
.with_section_content('keystone_authtoken', /^#{Regexp.quote(line)}$/)
|
||||||
|
@ -145,7 +145,7 @@ describe 'openstack-compute::nova-common' do
|
||||||
'username = placement',
|
'username = placement',
|
||||||
'project_name = service',
|
'project_name = service',
|
||||||
'user_domain_name = Default',
|
'user_domain_name = Default',
|
||||||
'project_domain_name = Default'
|
'project_domain_name = Default',
|
||||||
].each do |line|
|
].each do |line|
|
||||||
expect(chef_run).to render_config_file(file.name)\
|
expect(chef_run).to render_config_file(file.name)\
|
||||||
.with_section_content('placement', /^#{Regexp.quote(line)}$/)
|
.with_section_content('placement', /^#{Regexp.quote(line)}$/)
|
||||||
|
@ -155,7 +155,7 @@ describe 'openstack-compute::nova-common' do
|
||||||
|
|
||||||
it 'uses default values for attributes' do
|
it 'uses default values for attributes' do
|
||||||
[
|
[
|
||||||
%r{^api_servers = http://127.0.0.1:9292$}
|
%r{^api_servers = http://127.0.0.1:9292$},
|
||||||
|
|
||||||
].each do |line|
|
].each do |line|
|
||||||
expect(chef_run).to render_config_file(file.name)\
|
expect(chef_run).to render_config_file(file.name)\
|
||||||
|
@ -169,7 +169,7 @@ describe 'openstack-compute::nova-common' do
|
||||||
/^project_name = service$/,
|
/^project_name = service$/,
|
||||||
/^user_domain_name = Default/,
|
/^user_domain_name = Default/,
|
||||||
/^project_domain_name = Default/,
|
/^project_domain_name = Default/,
|
||||||
%r{^url = http://127.0.0.1:9696$}
|
%r{^url = http://127.0.0.1:9696$},
|
||||||
].each do |line|
|
].each do |line|
|
||||||
expect(chef_run).to render_config_file(file.name)\
|
expect(chef_run).to render_config_file(file.name)\
|
||||||
.with_section_content('neutron', line)
|
.with_section_content('neutron', line)
|
||||||
|
@ -243,7 +243,7 @@ describe 'openstack-compute::nova-common' do
|
||||||
|
|
||||||
it 'has vmware config options set' do
|
it 'has vmware config options set' do
|
||||||
[
|
[
|
||||||
/^host_password = vmware_secret_name$/
|
/^host_password = vmware_secret_name$/,
|
||||||
].each do |line|
|
].each do |line|
|
||||||
expect(chef_run).to render_config_file(file.name)\
|
expect(chef_run).to render_config_file(file.name)\
|
||||||
.with_section_content('vmware', line)
|
.with_section_content('vmware', line)
|
||||||
|
@ -279,7 +279,7 @@ describe 'openstack-compute::nova-common' do
|
||||||
/^images_rbd_pool = instances$/,
|
/^images_rbd_pool = instances$/,
|
||||||
%r{^images_rbd_ceph_conf = /etc/ceph/ceph.conf$},
|
%r{^images_rbd_ceph_conf = /etc/ceph/ceph.conf$},
|
||||||
/^rbd_user = cinder$/,
|
/^rbd_user = cinder$/,
|
||||||
/^rbd_secret_uuid = 00000000-0000-0000-0000-000000000000$/
|
/^rbd_secret_uuid = 00000000-0000-0000-0000-000000000000$/,
|
||||||
].each do |line|
|
].each do |line|
|
||||||
expect(chef_run).to render_config_file(file.name)\
|
expect(chef_run).to render_config_file(file.name)\
|
||||||
.with_section_content('libvirt', line)
|
.with_section_content('libvirt', line)
|
||||||
|
@ -298,7 +298,7 @@ describe 'openstack-compute::nova-common' do
|
||||||
[
|
[
|
||||||
/^images_type = rbd$/,
|
/^images_type = rbd$/,
|
||||||
/^images_rbd_pool = myrbd$/,
|
/^images_rbd_pool = myrbd$/,
|
||||||
%r{^images_rbd_ceph_conf = /etc/myceph/ceph.conf$}
|
%r{^images_rbd_ceph_conf = /etc/myceph/ceph.conf$},
|
||||||
].each do |line|
|
].each do |line|
|
||||||
expect(chef_run).to render_config_file(file.name)\
|
expect(chef_run).to render_config_file(file.name)\
|
||||||
.with_section_content('libvirt', line)
|
.with_section_content('libvirt', line)
|
||||||
|
@ -317,7 +317,7 @@ describe 'openstack-compute::nova-common' do
|
||||||
[
|
[
|
||||||
/^images_type = lvm$/,
|
/^images_type = lvm$/,
|
||||||
/^images_volume_group = instances$/,
|
/^images_volume_group = instances$/,
|
||||||
/^sparse_logical_volumes = false$/
|
/^sparse_logical_volumes = false$/,
|
||||||
].each do |line|
|
].each do |line|
|
||||||
expect(chef_run).to render_config_file(file.name)\
|
expect(chef_run).to render_config_file(file.name)\
|
||||||
.with_section_content('libvirt', line)
|
.with_section_content('libvirt', line)
|
||||||
|
@ -352,7 +352,7 @@ describe 'openstack-compute::nova-common' do
|
||||||
# /^enabled = False$/,
|
# /^enabled = False$/,
|
||||||
%r{base_url = ws://127.0.0.1:6083$},
|
%r{base_url = ws://127.0.0.1:6083$},
|
||||||
# /^port_range = 10000:20000$/,
|
# /^port_range = 10000:20000$/,
|
||||||
/^proxyclient_address = 127.0.0.1$/
|
/^proxyclient_address = 127.0.0.1$/,
|
||||||
].each do |line|
|
].each do |line|
|
||||||
expect(chef_run).to render_config_file(file.name)\
|
expect(chef_run).to render_config_file(file.name)\
|
||||||
.with_section_content('serial_console', line)
|
.with_section_content('serial_console', line)
|
||||||
|
@ -371,7 +371,7 @@ describe 'openstack-compute::nova-common' do
|
||||||
# /^enabled = True$/,
|
# /^enabled = True$/,
|
||||||
%r{base_url = wss://1.1.1.1:6082$},
|
%r{base_url = wss://1.1.1.1:6082$},
|
||||||
# /^port_range = 11000:15000$/,
|
# /^port_range = 11000:15000$/,
|
||||||
/^proxyclient_address = 127.0.0.1$/
|
/^proxyclient_address = 127.0.0.1$/,
|
||||||
].each do |line|
|
].each do |line|
|
||||||
expect(chef_run).to render_config_file(file.name)\
|
expect(chef_run).to render_config_file(file.name)\
|
||||||
.with_section_content('serial_console', line)
|
.with_section_content('serial_console', line)
|
||||||
|
@ -435,7 +435,7 @@ describe 'openstack-compute::nova-common' do
|
||||||
%r{^exec_dirs = /sbin,/usr/sbin,/bin,/usr/bin$},
|
%r{^exec_dirs = /sbin,/usr/sbin,/bin,/usr/bin$},
|
||||||
/^use_syslog = False$/,
|
/^use_syslog = False$/,
|
||||||
/^syslog_log_facility = syslog$/,
|
/^syslog_log_facility = syslog$/,
|
||||||
/^syslog_log_level = ERROR$/
|
/^syslog_log_level = ERROR$/,
|
||||||
].each do |line|
|
].each do |line|
|
||||||
expect(chef_run).to render_file(file.name).with_content(line)
|
expect(chef_run).to render_file(file.name).with_content(line)
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,15 +10,15 @@ describe 'openstack-compute::placement_api' do
|
||||||
|
|
||||||
include_context 'compute_stubs'
|
include_context 'compute_stubs'
|
||||||
|
|
||||||
it "includes nova-common recipe" do
|
it 'includes nova-common recipe' do
|
||||||
expect(chef_run).to include_recipe 'openstack-compute::nova-common'
|
expect(chef_run).to include_recipe 'openstack-compute::nova-common'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "upgrades package nova-placement-api" do
|
it 'upgrades package nova-placement-api' do
|
||||||
expect(chef_run).to upgrade_package 'nova-placement-api'
|
expect(chef_run).to upgrade_package 'nova-placement-api'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "executes placement-api: nova-manage api_db sync" do
|
it 'executes placement-api: nova-manage api_db sync' do
|
||||||
expect(chef_run).to run_execute('placement-api: nova-manage api_db sync').with(
|
expect(chef_run).to run_execute('placement-api: nova-manage api_db sync').with(
|
||||||
timeout: 3600,
|
timeout: 3600,
|
||||||
user: 'nova',
|
user: 'nova',
|
||||||
|
@ -27,7 +27,7 @@ describe 'openstack-compute::placement_api' do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "disables nova-placement-api service" do
|
it 'disables nova-placement-api service' do
|
||||||
expect(chef_run).to disable_service 'disable nova-placement-api service'
|
expect(chef_run).to disable_service 'disable nova-placement-api service'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,13 +13,13 @@ LOG_LEVEL = :fatal
|
||||||
REDHAT_OPTS = {
|
REDHAT_OPTS = {
|
||||||
platform: 'redhat',
|
platform: 'redhat',
|
||||||
version: '7.1',
|
version: '7.1',
|
||||||
log_level: LOG_LEVEL
|
log_level: LOG_LEVEL,
|
||||||
}.freeze
|
}.freeze
|
||||||
UBUNTU_OPTS = {
|
UBUNTU_OPTS = {
|
||||||
platform: 'ubuntu',
|
platform: 'ubuntu',
|
||||||
version: '16.04',
|
version: '16.04',
|
||||||
log_level: LOG_LEVEL,
|
log_level: LOG_LEVEL,
|
||||||
file_cache_path: Chef::Config[:file_cache_path]
|
file_cache_path: Chef::Config[:file_cache_path],
|
||||||
}.freeze
|
}.freeze
|
||||||
|
|
||||||
shared_context 'compute_stubs' do
|
shared_context 'compute_stubs' do
|
||||||
|
@ -35,9 +35,9 @@ shared_context 'compute_stubs' do
|
||||||
'openstack' => {
|
'openstack' => {
|
||||||
'identity' => {
|
'identity' => {
|
||||||
'admin_tenant_name' => 'admin',
|
'admin_tenant_name' => 'admin',
|
||||||
'admin_user' => 'admin'
|
'admin_user' => 'admin',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}]
|
}]
|
||||||
)
|
)
|
||||||
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
|
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
|
||||||
|
@ -88,7 +88,7 @@ shared_context 'compute_stubs' do
|
||||||
# stub_command('nova-manage network list | grep 192.168.100.0/24').and_return(false)
|
# stub_command('nova-manage network list | grep 192.168.100.0/24').and_return(false)
|
||||||
# stub_command('nova-manage network list | grep 192.168.200.0/24').and_return(false)
|
# stub_command('nova-manage network list | grep 192.168.200.0/24').and_return(false)
|
||||||
# stub_command("nova-manage floating list |grep -E '.*([0-9]{1,3}[.]){3}[0-9]{1,3}*'").and_return(false)
|
# stub_command("nova-manage floating list |grep -E '.*([0-9]{1,3}[.]){3}[0-9]{1,3}*'").and_return(false)
|
||||||
stub_command("/usr/sbin/apache2 -t").and_return(true)
|
stub_command('/usr/sbin/apache2 -t').and_return(true)
|
||||||
stub_command('virsh net-list | grep -q default').and_return(true)
|
stub_command('virsh net-list | grep -q default').and_return(true)
|
||||||
stub_command('ovs-vsctl br-exists br-int').and_return(true)
|
stub_command('ovs-vsctl br-exists br-int').and_return(true)
|
||||||
stub_command('ovs-vsctl br-exists br-tun').and_return(true)
|
stub_command('ovs-vsctl br-exists br-tun').and_return(true)
|
||||||
|
|
|
@ -30,17 +30,20 @@ use = call:nova.api.openstack.urlmap:urlmap_factory
|
||||||
|
|
||||||
[composite:openstack_compute_api_v21]
|
[composite:openstack_compute_api_v21]
|
||||||
use = call:nova.api.auth:pipeline_factory_v21
|
use = call:nova.api.auth:pipeline_factory_v21
|
||||||
noauth2 = cors http_proxy_to_wsgi compute_req_id faultwrap sizelimit osprofiler noauth2 osapi_compute_app_v21
|
noauth2 = cors http_proxy_to_wsgi compute_req_id faultwrap request_log sizelimit osprofiler noauth2 osapi_compute_app_v21
|
||||||
keystone = cors http_proxy_to_wsgi compute_req_id faultwrap sizelimit osprofiler authtoken keystonecontext osapi_compute_app_v21
|
keystone = cors http_proxy_to_wsgi compute_req_id faultwrap request_log sizelimit osprofiler authtoken keystonecontext osapi_compute_app_v21
|
||||||
|
|
||||||
[composite:openstack_compute_api_v21_legacy_v2_compatible]
|
[composite:openstack_compute_api_v21_legacy_v2_compatible]
|
||||||
use = call:nova.api.auth:pipeline_factory_v21
|
use = call:nova.api.auth:pipeline_factory_v21
|
||||||
noauth2 = cors http_proxy_to_wsgi compute_req_id faultwrap sizelimit osprofiler noauth2 legacy_v2_compatible osapi_compute_app_v21
|
noauth2 = cors http_proxy_to_wsgi compute_req_id faultwrap request_log sizelimit osprofiler noauth2 legacy_v2_compatible osapi_compute_app_v21
|
||||||
keystone = cors http_proxy_to_wsgi compute_req_id faultwrap sizelimit osprofiler authtoken keystonecontext legacy_v2_compatible osapi_compute_app_v21
|
keystone = cors http_proxy_to_wsgi compute_req_id faultwrap request_log sizelimit osprofiler authtoken keystonecontext legacy_v2_compatible osapi_compute_app_v21
|
||||||
|
|
||||||
[filter:request_id]
|
[filter:request_id]
|
||||||
paste.filter_factory = oslo_middleware:RequestId.factory
|
paste.filter_factory = oslo_middleware:RequestId.factory
|
||||||
|
|
||||||
|
[filter:request_log]
|
||||||
|
paste.filter_factory = nova.api.openstack.requestlog:RequestLog.factory
|
||||||
|
|
||||||
[filter:compute_req_id]
|
[filter:compute_req_id]
|
||||||
paste.filter_factory = nova.api.compute_req_id:ComputeReqIdMiddleware.factory
|
paste.filter_factory = nova.api.compute_req_id:ComputeReqIdMiddleware.factory
|
||||||
|
|
||||||
|
@ -66,7 +69,7 @@ paste.filter_factory = nova.api.openstack:LegacyV2CompatibleWrapper.factory
|
||||||
paste.app_factory = nova.api.openstack.compute:APIRouterV21.factory
|
paste.app_factory = nova.api.openstack.compute:APIRouterV21.factory
|
||||||
|
|
||||||
[pipeline:oscomputeversions]
|
[pipeline:oscomputeversions]
|
||||||
pipeline = cors faultwrap http_proxy_to_wsgi oscomputeversionapp
|
pipeline = cors faultwrap request_log http_proxy_to_wsgi oscomputeversionapp
|
||||||
|
|
||||||
[app:oscomputeversionapp]
|
[app:oscomputeversionapp]
|
||||||
paste.app_factory = nova.api.openstack.compute.versions:Versions.factory
|
paste.app_factory = nova.api.openstack.compute.versions:Versions.factory
|
||||||
|
|
Loading…
Reference in New Issue