Replace allow_get check with allow_fetch

We got rid of all allow_get checks in the code and now can let SDK drop
the attribute

Change-Id: I61750cc491cf769b1daf42af2eca6b6199fa2b5d
This commit is contained in:
Artem Goncharov 2022-01-17 11:01:59 +01:00
parent 58eff5e7f9
commit 650795af70
1 changed files with 6 additions and 1 deletions

View File

@ -723,10 +723,15 @@ def get_osc_show_columns_for_sdk_resource(
columns
"""
if getattr(sdk_resource, 'allow_get', None) is not None:
if getattr(sdk_resource, 'allow_fetch', None) is not None:
# OSC at the moment lands here with FakeResource objects which are not
# 100% sdk compatible. Unless we introduce SDK test/fake resources we
# should check presence of the specific method
resource_dict = sdk_resource.to_dict(
body=True, headers=False, ignore_none=False)
else:
# We might land here with not a real SDK Resource (during the
# transition period).
resource_dict = sdk_resource
# Build the OSC column names to display for the SDK resource.