From 9efcb475cff6dd99363a239424a3febccb76374a Mon Sep 17 00:00:00 2001
From: Goutham Pacha Ravi <gouthampravi@gmail.com>
Date: Wed, 3 Feb 2021 10:18:54 -0800
Subject: [PATCH] [devstack] create endpoint without project_id

As of API version 2.60, a project_id is no
longer needed in the API URLs. We can stop
devstack from setting up an endpoint with
project_id in it.

Create a "sharev2_legacy" endpoint that
contains the project_id for testing the
compatibility with the older style of URLs.

Change-Id: I25aeb1b6dd1a4150c6e542e29b7d43e18d9ad94c
Implements: bp remove-project-id-from-urls
Depends-On: I5127e150e8a71e621890f30dba6720b3932cf583
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
---
 devstack/plugin.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/devstack/plugin.sh b/devstack/plugin.sh
index e9d36dfd5d..3f9c6660af 100755
--- a/devstack/plugin.sh
+++ b/devstack/plugin.sh
@@ -488,9 +488,17 @@ function create_manila_accounts {
     get_or_create_endpoint "share" "$REGION_NAME" \
         "$MANILA_ENDPOINT_BASE/v1/\$(project_id)s"
 
-    # Set up Manila v2 service and endpoint
+    # Set up Manila v2 service and endpoint - as of microversion 2.60,
+    # project_id is no longer necessary in the v2 endpoint
     get_or_create_service "manilav2" "sharev2" "Manila Shared Filesystem Service V2"
     get_or_create_endpoint "sharev2" "$REGION_NAME" \
+        "$MANILA_ENDPOINT_BASE/v2"
+
+    # Set up Manila legacy v2 service and endpoint - as of microversion 2.60,
+    # project_id is no longer necessary in the v2 endpoint
+    get_or_create_service "manilav2_legacy" "sharev2_legacy" "Manila Shared
+    Filesystem Service V2 (Legacy 2.0)"
+    get_or_create_endpoint "sharev2_legacy" "$REGION_NAME" \
         "$MANILA_ENDPOINT_BASE/v2/\$(project_id)s"
 }