Adds provides method to define name of resources
In Chef Infra Client 16.2, resources have to be named using the provides method. The resource_name method has not been changed in order to be compatible with Chef Infra Client <16.2. Also fix URI.encode and URI.decode deprecations. Update etcd depends to ~> 6.0 to fix Chef 16 deprecation warnings. Depends-On: https://review.opendev.org/747503 Change-Id: I24be89a3214207bac2df9eb360124871e0d8242f Closes-Bug: #1886985 Signed-off-by: Henrique Santos <hfigueiredosantos@tecnico.ulisboa.pt> Signed-off-by: Lance Albertson <lance@osuosl.org>
This commit is contained in:
parent
a45cea15d7
commit
455790e1e9
|
@ -24,7 +24,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
|
||||
|
|
|
@ -32,7 +32,7 @@ module ::Openstack
|
|||
# @return [Hash] environment
|
||||
def openstack_command_env(name, project, user_domain, project_domain)
|
||||
identity_endpoint = public_endpoint 'identity'
|
||||
auth_url = ::URI.decode identity_endpoint.to_s
|
||||
auth_url = identity_endpoint.to_s
|
||||
|
||||
pass = get_password 'user', name
|
||||
{
|
||||
|
|
|
@ -43,13 +43,13 @@ module ::Openstack
|
|||
def encrypted_secret(bag_name, index)
|
||||
key_path = node['openstack']['secret']['key_path']
|
||||
::Chef::Log.info "Loading encrypted databag #{bag_name}.#{index} using key at #{key_path}"
|
||||
secret = ::Chef::EncryptedDataBagItem.load_secret key_path # ~FC086
|
||||
::Chef::EncryptedDataBagItem.load(bag_name, index, secret)[index] # ~FC086
|
||||
secret = ::Chef::EncryptedDataBagItem.load_secret key_path
|
||||
::Chef::EncryptedDataBagItem.load(bag_name, index, secret)[index]
|
||||
end
|
||||
|
||||
def standard_secret(bag_name, index)
|
||||
::Chef::Log.info "Loading databag #{bag_name}.#{index}"
|
||||
::Chef::DataBagItem.load(bag_name, index)[index] # ~FC086
|
||||
::Chef::DataBagItem.load(bag_name, index)[index]
|
||||
end
|
||||
|
||||
def vault_secret(bag_name, index)
|
||||
|
|
|
@ -26,6 +26,7 @@ class Chef
|
|||
class Resource
|
||||
class Database < Chef::Resource
|
||||
resource_name :database
|
||||
provides :database
|
||||
|
||||
default_action :create
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ class Chef
|
|||
class Resource
|
||||
class DatabaseUser < Chef::Resource::Database
|
||||
resource_name :database_user
|
||||
provides :database_user
|
||||
|
||||
default_action :create
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ class Chef
|
|||
class Resource
|
||||
class MysqlDatabase < Chef::Resource::Database
|
||||
resource_name :mysql_database
|
||||
provides :mysql_database
|
||||
|
||||
def initialize(name, run_context = nil)
|
||||
super
|
||||
|
|
|
@ -27,6 +27,7 @@ class Chef
|
|||
class Resource
|
||||
class MysqlDatabaseUser < Chef::Resource::DatabaseUser
|
||||
resource_name :mysql_database_user
|
||||
provides :mysql_database_user
|
||||
|
||||
def initialize(name, run_context = nil)
|
||||
super
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#
|
||||
|
||||
require 'uri'
|
||||
require 'addressable/uri'
|
||||
|
||||
# URI methods
|
||||
module ::Openstack
|
||||
|
@ -29,7 +30,7 @@ module ::Openstack
|
|||
# keys are used directly from the hash.
|
||||
def uri_from_hash(hash)
|
||||
if hash['uri']
|
||||
::URI.parse ::URI.encode(hash['uri'])
|
||||
::URI.parse Addressable::URI.encode(hash['uri'])
|
||||
else
|
||||
host = hash['host']
|
||||
scheme = hash['scheme'] ? hash['scheme'] : 'http'
|
||||
|
|
|
@ -9,7 +9,7 @@ version '20.0.0'
|
|||
supports os
|
||||
end
|
||||
|
||||
depends 'etcd', '~> 5.6'
|
||||
depends 'etcd', '~> 6.0'
|
||||
depends 'mariadb', '~> 4.0'
|
||||
depends 'memcached', '~> 6.0'
|
||||
depends 'selinux'
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
# Original: https://github.com/chef-boneyard/database
|
||||
|
||||
resource_name :openstack_database
|
||||
provides :openstack_database
|
||||
default_action :create
|
||||
|
||||
property :service, String, name_property: true
|
||||
|
|
Loading…
Reference in New Issue