If parser Tosca error happens, it may not exist version info;
So it needs a process before print it.
JIRA: PARSER-183
Change-Id: I283d1d794b0db19f83a9abc0eee3962e94e21572
Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
else:
raise e
- version = tosca.version if tosca else "unknown"
- if tosca and tosca.version:
- print("\nversion: " + version)
+ if tosca and hasattr(tosca, 'version'):
+ print("\nversion: " + tosca.version)
+ else:
+ print("\nversion: " + "unknown")
if tosca and hasattr(tosca, 'description'):
description = tosca.description