Filter out the path variable of field

One RSD resource may contains several fields that also have _path
variable. That is useless info to user. So filter them out.

Change-Id: Idf453f452603713c8efd64336eee791c656a1d86
This commit is contained in:
Lin Yang 2018-06-07 11:29:35 -07:00
parent 52440b40bc
commit 887269f6c8
2 changed files with 2 additions and 1 deletions

View File

@ -6,3 +6,4 @@ pbr>=2.0 # Apache-2.0
cliff>=2.8.0 # Apache-2.0
osc-lib>=1.7.0 # Apache-2.0
rsd-lib>=0.0.1 # Apache-2.0
six>=1.10.0 # MIT

View File

@ -36,7 +36,7 @@ def extract_attr(redfish_obj):
result = {}
try:
for key, value in vars(redfish_obj).items():
if key == '_path':
if key == '_path' and isinstance(value, six.string_types):
result['path'] = extract_attr(value)
continue
# Skip all private attributes