Chef 16 fixes

Depends-On: https://review.opendev.org/747602
Depends-On: https://review.opendev.org/747557
Change-Id: I73514e34628dbf61a35f6e0ad19191cdeb2b6451
Signed-off-by: Lance Albertson <lance@osuosl.org>
This commit is contained in:
Lance Albertson 2020-08-23 19:40:49 -07:00
parent 5747451dcb
commit d645ef3f5e
5 changed files with 8 additions and 24 deletions

View File

@ -21,7 +21,7 @@ Requirements
============
- Chef 15 or higher
- Chef Workstation 0.18.3 for testing (also includes Berkshelf for
- Chef Workstation 20.8.111 for testing (also includes Berkshelf for
cookbook dependency resolution)
Platform

View File

@ -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'

View File

@ -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

View File

@ -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
@ -118,7 +116,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: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}")
@ -133,7 +131,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'

View File

@ -44,7 +44,7 @@ end
db_user = node['openstack']['db']['placement']['username']
db_pass = get_password 'db', 'placement'
identity_endpoint = internal_endpoint 'identity'
auth_url = ::URI.decode identity_endpoint.to_s
auth_url = identity_endpoint.to_s
node.default['openstack']['placement']['conf_secrets']
.[]('placement_database')['connection'] =
@ -64,7 +64,7 @@ end
memcache_servers = memcached_servers.join ','
placement_api_endpoint = internal_endpoint 'placement-api'
Chef::Log.debug("openstack-compute::placement_api:placement_api_endpoint|#{::URI.decode placement_api_endpoint.to_s}")
Chef::Log.debug("openstack-compute::placement_api:placement_api_endpoint|#{placement_api_endpoint}")
node.default['openstack']['placement']['conf'].tap do |conf|
unless memcache_servers.empty?