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:
		| @@ -6,3 +6,4 @@ pbr>=2.0 # Apache-2.0 | |||||||
| cliff>=2.8.0 # Apache-2.0 | cliff>=2.8.0 # Apache-2.0 | ||||||
| osc-lib>=1.7.0 # Apache-2.0 | osc-lib>=1.7.0 # Apache-2.0 | ||||||
| rsd-lib>=0.0.1 # Apache-2.0 | rsd-lib>=0.0.1 # Apache-2.0 | ||||||
|  | six>=1.10.0 # MIT | ||||||
|   | |||||||
| @@ -36,7 +36,7 @@ def extract_attr(redfish_obj): | |||||||
|     result = {} |     result = {} | ||||||
|     try: |     try: | ||||||
|         for key, value in vars(redfish_obj).items(): |         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) |                 result['path'] = extract_attr(value) | ||||||
|                 continue |                 continue | ||||||
|             # Skip all private attributes |             # Skip all private attributes | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Lin Yang
					Lin Yang