Chef 16 fixes
Depends-On: https://review.opendev.org/749851 Depends-On: https://review.opendev.org/750021 Change-Id: I145d988754f03c9a64b9ee34c6c6184d8eba0d40 Signed-off-by: Lance Albertson <lance@osuosl.org>
This commit is contained in:
@@ -13,9 +13,3 @@ Style/IfUnlessModifier:
|
||||
- 'attributes/nova_conf.rb'
|
||||
- 'recipes/libvirt.rb'
|
||||
- 'recipes/nova-common.rb'
|
||||
|
||||
# Offense count: 97
|
||||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
||||
# URISchemes: http, https
|
||||
Metrics/LineLength:
|
||||
Max: 171
|
||||
|
||||
@@ -21,7 +21,7 @@ Requirements
|
||||
============
|
||||
|
||||
- Chef 15 or higher
|
||||
- Chef Workstation 0.15.18 for testing (also includes Berkshelf for
|
||||
- Chef Workstation 20.8.111 for testing (also includes Berkshelf for
|
||||
cookbook dependency resolution)
|
||||
|
||||
Platform
|
||||
|
||||
@@ -5,7 +5,7 @@ issues_url 'https://launchpad.net/openstack-chef'
|
||||
source_url 'https://opendev.org/openstack/cookbook-openstack-compute'
|
||||
license 'Apache-2.0'
|
||||
description 'The OpenStack Compute service Nova.'
|
||||
version '19.2.0'
|
||||
version '19.3.0'
|
||||
|
||||
chef_version '>= 15.0'
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
require 'uri'
|
||||
|
||||
class ::Chef::Recipe
|
||||
include ::Openstack
|
||||
end
|
||||
@@ -35,7 +33,7 @@ placement_interfaces = {
|
||||
public: { url: public_endpoint('placement-api') },
|
||||
internal: { url: internal_endpoint('placement-api') },
|
||||
}
|
||||
auth_url = ::URI.decode identity_endpoint.to_s
|
||||
auth_url = identity_endpoint.to_s
|
||||
service_pass = get_password 'service', 'openstack-compute'
|
||||
service_user = node['openstack']['compute']['conf']['keystone_authtoken']['username']
|
||||
placement_service_pass = get_password 'service', 'openstack-placement'
|
||||
|
||||
@@ -55,22 +55,10 @@ def update_grub_default_kernel(flavor = 'default')
|
||||
# change default option for /boot/grub/menu.lst
|
||||
unless current_default.eql?(default_boot)
|
||||
::Chef::Log.info("Changed grub default to #{default_boot}")
|
||||
Mixlib::ShellOut.new("sed -i -e 's;^default.*;default #{default_boot};' /boot/grub/menu.lst").run_command
|
||||
shell_out("sed -i -e 's;^default.*;default #{default_boot};' /boot/grub/menu.lst")
|
||||
end
|
||||
end
|
||||
|
||||
# def update_grub2_default_kernel(flavor = 'default')
|
||||
# boot_entry = "'openSUSE GNU/Linux, with Xen hypervisor'"
|
||||
# begin
|
||||
# Mixlib::ShellOut.new("grub2-set-default #{boot_entry}").run_command.error!
|
||||
# ::Chef::Log.info("Changed grub2 default to #{boot_entry}")
|
||||
# rescue Mixlib::ShellOut::ShellCommandFailed => e
|
||||
# ::Chef::Application.fatal!(
|
||||
# "Unable to change grub2 default to #{boot_entry}
|
||||
# #{e.message}")
|
||||
# end
|
||||
# end
|
||||
|
||||
def update_boot_kernel_and_trigger_reboot(flavor = 'default')
|
||||
# only default and xen flavor is supported by this helper right now
|
||||
if File.exist?('/boot/grub/menu.lst')
|
||||
@@ -85,7 +73,7 @@ def update_boot_kernel_and_trigger_reboot(flavor = 'default')
|
||||
|
||||
# trigger reboot through reboot_handler, if kernel-$flavor is not yet
|
||||
# running
|
||||
unless Mixlib::ShellOut.new('uname -r').run_command.stdout.include?(flavor)
|
||||
unless shell_out('uname -r').stdout.include?(flavor)
|
||||
node.run_state['reboot'] = true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
require 'uri'
|
||||
|
||||
# Make Openstack object available in Chef::Recipe
|
||||
class ::Chef::Recipe
|
||||
include ::Openstack
|
||||
@@ -122,7 +120,7 @@ image_endpoint = internal_endpoint 'image_api'
|
||||
Chef::Log.debug("openstack-compute::nova-common:identity_endpoint|#{identity_endpoint}")
|
||||
Chef::Log.debug("openstack-compute::nova-common:xvpvnc_endpoint|#{xvpvnc_endpoint}")
|
||||
Chef::Log.debug("openstack-compute::nova-common:novnc_endpoint|#{novnc_endpoint}")
|
||||
Chef::Log.debug("openstack-compute::nova-common:compute_api_endpoint|#{::URI.decode compute_api_endpoint.to_s}")
|
||||
Chef::Log.debug("openstack-compute::nova-common:compute_api_endpoint|#{compute_api_endpoint}")
|
||||
Chef::Log.debug("openstack-compute::nova-common:network_endpoint|#{network_endpoint}")
|
||||
Chef::Log.debug("openstack-compute::nova-common:image_endpoint|#{image_endpoint}")
|
||||
# Chef::Log.debug("openstack-compute::nova-common:ironic_endpoint|#{ironic_endpoint}")
|
||||
@@ -137,7 +135,7 @@ node.default['openstack']['compute']['conf_secrets']
|
||||
.[]('neutron')['metadata_proxy_shared_secret'] =
|
||||
get_password 'token', 'neutron_metadata_secret'
|
||||
|
||||
auth_url = ::URI.decode identity_endpoint.to_s
|
||||
auth_url = identity_endpoint.to_s
|
||||
node.default['openstack']['compute']['conf_secrets']
|
||||
.[]('keystone_authtoken')['password'] =
|
||||
get_password 'service', 'openstack-compute'
|
||||
|
||||
Reference in New Issue
Block a user