From cb14e965efbdda1ae55f85b4650d299f2c08d0bf Mon Sep 17 00:00:00 2001
From: Goutham Pacha Ravi <gouthampravi@gmail.com>
Date: Mon, 19 Dec 2022 12:36:57 -0800
Subject: [PATCH] Fix functional tests failing with python 3.10

argparse module had a change [1] in header text denoting optional
arguments. The header text now reads "options" instead of
"optional arguments"

[1] https://docs.python.org/3/whatsnew/3.10.html#argparse
Closes-Bug: #2000092

Change-Id: I2d7caa6e3c5a6a493639dc655a6722992540281e
---
 manilaclient/tests/functional/test_common.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/manilaclient/tests/functional/test_common.py b/manilaclient/tests/functional/test_common.py
index 2b552a170..06fa77f3f 100644
--- a/manilaclient/tests/functional/test_common.py
+++ b/manilaclient/tests/functional/test_common.py
@@ -35,7 +35,11 @@ class ManilaClientTestCommonReadOnly(base.BaseTestCase):
 
         commands = []
         cmds_start = lines.index('Positional arguments:')
-        cmds_end = lines.index('Optional arguments:')
+        try:
+            # TODO(gouthamr): Drop when py3.10 becomes min supported version
+            cmds_end = lines.index('Optional arguments:')
+        except ValueError:
+            cmds_end = lines.index('Options:')
         command_pattern = re.compile(r'^ {4}([a-z0-9\-\_]+)')
         for line in lines[cmds_start:cmds_end]:
             match = command_pattern.match(line)