Merge "Fix option to override API endpoint"

This commit is contained in:
Zuul
2026-04-16 15:56:41 +00:00
committed by Gerrit Code Review
3 changed files with 20 additions and 4 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ Client. In this case, you can use configuration option
``--os-endpoint-override`` or set the corresponding environment
variable::
export OS_ENDPOINT_OVERRIDE=http://...
export OS_SHARED_FILE_SYSTEM_ENDPOINT_OVERRIDE=http://...
Getting help
+12 -3
View File
@@ -64,9 +64,17 @@ def make_client(instance):
"""Returns a shared file system service client."""
requested_api_version = instance._api_version[API_NAME]
service_type, manila_endpoint_url = _get_manila_url_from_service_catalog(
instance
endpoint_override = getattr(
instance._cli_options, 'os_endpoint_override', None
)
if endpoint_override:
manila_endpoint_url = endpoint_override
service_type = constants.SFS_SERVICE_TYPE
else:
service_type, manila_endpoint_url = (
_get_manila_url_from_service_catalog(instance)
)
instance.setup_auth()
debugging_enabled = instance._cli_options.debug
@@ -128,13 +136,14 @@ def build_option_parser(parser):
"--os-endpoint-override",
metavar="<endpoint-override>",
default=utils.env(
"OS_SHARED_FILE_SYSTEM_ENDPOINT_OVERRIDE",
"OS_ENDPOINT_OVERRIDE",
"OS_MANILA_BYPASS_URL",
"MANILACLIENT_BYPASS_URL",
),
help=(
"Use this API endpoint instead of the Service Catalog. "
"Defaults to env[OS_ENDPOINT_OVERRIDE]."
"Defaults to env[OS_SHARED_FILE_SYSTEM_ENDPOINT_OVERRIDE]."
),
)
return parser
@@ -0,0 +1,7 @@
---
fixes:
- |
In addition to existing "--os-endpoint-override" option to override API
endpoint, user can also use export variable. For example, use
"export OS_SHARED_FILE_SYSTEM_ENDPOINT_OVERRIDE=<endpoint_url>" and then
use "openstack share list" command to refer different Manila API endpoint.