Fix experimental=True for view in microversion 2.5
A previous patch added experimental=True to hide task_state field
for any API call that would return share fields, such as "create"
and "get" calls if different than microversion "2.5" with
experimental=True. Turns out the field task_state should be
returned always if microversion is "2.5" or above because it
relates to a change in DB, not only to the usage of Share Migration
feature. This patch fixes it by removing experimental=True
dependency to show task_state field.
Closes-bug: #1497352
Change-Id: Ic07d63ebcfe25c1cfa3fac1e75e2e186fbcec25b
diff --git a/manila_tempest_tests/services/share/v2/json/shares_client.py b/manila_tempest_tests/services/share/v2/json/shares_client.py
index 3387a4f..d3b6066 100644
--- a/manila_tempest_tests/services/share/v2/json/shares_client.py
+++ b/manila_tempest_tests/services/share/v2/json/shares_client.py
@@ -220,15 +220,8 @@
"""Get detailed list of shares w/o filters."""
return self.list_shares(detailed=True, params=params, version=version)
- def get_share(self, share_id, version=LATEST_MICROVERSION,
- experimental=False):
- headers = None
- extra_headers = False
- if experimental:
- headers = EXPERIMENTAL
- extra_headers = True
- resp, body = self.get("shares/%s" % share_id, version=version,
- headers=headers, extra_headers=extra_headers)
+ def get_share(self, share_id, version=LATEST_MICROVERSION):
+ resp, body = self.get("shares/%s" % share_id, version=version)
self.expected_success(200, resp.status)
return self._parse_resp(body)
@@ -498,14 +491,15 @@
headers=EXPERIMENTAL, extra_headers=True,
version=version)
- def wait_for_migration_completed(self, share_id, dest_host):
+ def wait_for_migration_completed(self, share_id, dest_host,
+ version=LATEST_MICROVERSION):
"""Waits for a share to migrate to a certain host."""
- share = self.get_share(share_id, "2.5", True)
+ share = self.get_share(share_id, version=version)
migration_timeout = CONF.share.migration_timeout
start = int(time.time())
while share['task_state'] != 'migration_success':
time.sleep(self.build_interval)
- share = self.get_share(share_id, "2.5", True)
+ share = self.get_share(share_id, version=version)
if share['task_state'] == 'migration_success':
return share
elif share['task_state'] == 'migration_error':