Fix concurrency issue in tempest test

Tempest test 'test_list_shares_with_detail_filter_by_extra_specs' fails
with following error from time to time:

ValueError: Share 'cdd499f7-6b02-4f47-8b39-7093b4d07e11' listed with
extra_specs filter has nonexistent share type 'share-type-1283899337'.

It happens because list of share types is taken for each step of a loop
Get list of share types only once and before taking list of shares, in
that case we will have share objects with still existing share types.

Change-Id: I0c29d16385255599b902757544e31ebbec79ca84
Closes-Bug: #1493125
diff --git a/manila_tempest_tests/tests/api/admin/test_shares_actions.py b/manila_tempest_tests/tests/api/admin/test_shares_actions.py
index b2904c4..0ce3d68 100644
--- a/manila_tempest_tests/tests/api/admin/test_shares_actions.py
+++ b/manila_tempest_tests/tests/api/admin/test_shares_actions.py
@@ -165,6 +165,7 @@
         filters = {
             "extra_specs": {'storage_protocol': CONF.share.storage_protocol}
         }
+        share_type_list = self.shares_client.list_share_types()["share_types"]
 
         # list shares
         shares = self.shares_client.list_shares_with_detail(params=filters)
@@ -175,12 +176,10 @@
         for share in self.shares:
             self.assertTrue(share["id"] in shares_ids)
         for share in shares:
-            st_list = self.shares_client.list_share_types()
             # find its name or id, get id
-            sts = st_list["share_types"]
             st_id = None
-            for st in sts:
-                if share["share_type"] in [st["id"], st["name"]]:
+            for st in share_type_list:
+                if share["share_type"] in (st["id"], st["name"]):
                     st_id = st["id"]
                     break
             if st_id is None: