From 7e6a118dfd37f2876f4dbdf009e0c3ce296a9ead Mon Sep 17 00:00:00 2001
From: Takashi Kajinami <tkajinam@redhat.com>
Date: Tue, 5 Oct 2021 21:41:10 +0900
Subject: [PATCH] Add missing oslo_limit options

Glance now depends on the oslo.limit library to support the unified
quota[1], but parameters of the library are still missing from
glance-api.conf.

This change ensures the parameter of the oslo.limit library are
included in glance-api.conf generated by oslo-config-generator.

[1] 06e6542f153a1ba197361f3f8cb0010c7d2d4285

Closes-Bug: #1946100
Change-Id: I56a2a9d8184f50624239b90dd9bef671c195fb90
---
 etc/glance-api.conf                       | 142 ++++++++++++++++++++++
 etc/oslo-config-generator/glance-api.conf |   1 +
 requirements.txt                          |   2 +-
 3 files changed, 144 insertions(+), 1 deletion(-)

diff --git a/etc/glance-api.conf b/etc/glance-api.conf
index e851c42152..a4be5413a0 100644
--- a/etc/glance-api.conf
+++ b/etc/glance-api.conf
@@ -5144,6 +5144,148 @@
 #lock_path = <None>
 
 
+[oslo_limit]
+
+#
+# From oslo.limit
+#
+
+# The service's endpoint id which is registered in Keystone. (string value)
+#endpoint_id = <None>
+
+# PEM encoded Certificate Authority to use when verifying HTTPs connections.
+# (string value)
+#cafile = <None>
+
+# PEM encoded client certificate cert file (string value)
+#certfile = <None>
+
+# PEM encoded client certificate key file (string value)
+#keyfile = <None>
+
+# Verify HTTPS connections. (boolean value)
+#insecure = false
+
+# Timeout value for http requests (integer value)
+#timeout = <None>
+
+# Collect per-API call timing information. (boolean value)
+#collect_timing = false
+
+# Log requests to multiple loggers. (boolean value)
+#split_loggers = false
+
+# Authentication URL (string value)
+#auth_url = <None>
+
+# Scope for system operations (string value)
+#system_scope = <None>
+
+# Domain ID to scope to (string value)
+#domain_id = <None>
+
+# Domain name to scope to (string value)
+#domain_name = <None>
+
+# Project ID to scope to (string value)
+#project_id = <None>
+
+# Project name to scope to (string value)
+#project_name = <None>
+
+# Domain ID containing project (string value)
+#project_domain_id = <None>
+
+# Domain name containing project (string value)
+#project_domain_name = <None>
+
+# ID of the trust to use as a trustee use (string value)
+#trust_id = <None>
+
+# Optional domain ID to use with v3 and v2 parameters. It will be used for both
+# the user and project domain in v3 and ignored in v2 authentication. (string
+# value)
+#default_domain_id = <None>
+
+# Optional domain name to use with v3 API and v2 parameters. It will be used for
+# both the user and project domain in v3 and ignored in v2 authentication.
+# (string value)
+#default_domain_name = <None>
+
+# User ID (string value)
+#user_id = <None>
+
+# Username (string value)
+# Deprecated group/name - [oslo_limit]/user_name
+#username = <None>
+
+# User's domain id (string value)
+#user_domain_id = <None>
+
+# User's domain name (string value)
+#user_domain_name = <None>
+
+# User's password (string value)
+#password = <None>
+
+# Tenant ID (string value)
+#tenant_id = <None>
+
+# Tenant Name (string value)
+#tenant_name = <None>
+
+# The default service_type for endpoint URL discovery. (string value)
+#service_type = <None>
+
+# The default service_name for endpoint URL discovery. (string value)
+#service_name = <None>
+
+# List of interfaces, in order of preference, for endpoint URL. (list value)
+#valid_interfaces = <None>
+
+# The default region_name for endpoint URL discovery. (string value)
+#region_name = <None>
+
+# Always use this endpoint URL for requests for this client. NOTE: The
+# unversioned endpoint should be specified here; to request a particular API
+# version, use the `version`, `min-version`, and/or `max-version` options.
+# (string value)
+#endpoint_override = <None>
+
+# Minimum Major API version within a given Major API version for endpoint URL
+# discovery. Mutually exclusive with min_version and max_version (string value)
+#version = <None>
+
+# The minimum major version of a given API, intended to be used as the lower
+# bound of a range with max_version. Mutually exclusive with version. If
+# min_version is given with no max_version it is as if max version is "latest".
+# (string value)
+#min_version = <None>
+
+# The maximum major version of a given API, intended to be used as the upper
+# bound of a range with min_version. Mutually exclusive with version. (string
+# value)
+#max_version = <None>
+
+# The maximum number of retries that should be attempted for connection errors.
+# (integer value)
+#connect_retries = <None>
+
+# Delay (in seconds) between two retries for connection errors. If not set,
+# exponential retry starting with 0.5 seconds up to a maximum of 60 seconds is
+# used. (floating point value)
+#connect_retry_delay = <None>
+
+# The maximum number of retries that should be attempted for retriable HTTP
+# status codes. (integer value)
+#status_code_retries = <None>
+
+# Delay (in seconds) between two retries for retriable status codes. If not set,
+# exponential retry starting with 0.5 seconds up to a maximum of 60 seconds is
+# used. (floating point value)
+#status_code_retry_delay = <None>
+
+
 [oslo_messaging_amqp]
 
 #
diff --git a/etc/oslo-config-generator/glance-api.conf b/etc/oslo-config-generator/glance-api.conf
index 8e1dc06c07..bafa606276 100644
--- a/etc/oslo-config-generator/glance-api.conf
+++ b/etc/oslo-config-generator/glance-api.conf
@@ -10,6 +10,7 @@ namespace = oslo.messaging
 namespace = oslo.db
 namespace = oslo.policy
 namespace = keystonemiddleware.auth_token
+namespace = oslo.limit
 namespace = oslo.log
 namespace = oslo.middleware.cors
 namespace = oslo.middleware.healthcheck
diff --git a/requirements.txt b/requirements.txt
index 1d24f6a2a3..0554a36474 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -36,7 +36,7 @@ pyOpenSSL>=17.1.0 # Apache-2.0
 
 oslo.db>=5.0.0 # Apache-2.0
 oslo.i18n>=5.0.0 # Apache-2.0
-oslo.limit>=1.4.0 # Apache-2.0
+oslo.limit>=1.6.0 # Apache-2.0
 oslo.log>=4.5.0 # Apache-2.0
 oslo.messaging>=5.29.0,!=9.0.0 # Apache-2.0
 oslo.middleware>=3.31.0 # Apache-2.0