Only print description in `service-templates` show if one exists
Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/298885fb Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/298885fb Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/298885fb Branch: refs/heads/ARIA-48-aria-cli Commit: 298885fbfdb6abdf68f643b579b0aca90c75dfd7 Parents: 2ffefc4 Author: Avia Efrat <a...@gigaspaces.com> Authored: Sun Apr 2 18:17:31 2017 +0300 Committer: Ran Ziv <r...@gigaspaces.com> Committed: Tue Apr 4 13:20:46 2017 +0300 ---------------------------------------------------------------------- aria/cli/commands/service_templates.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/298885fb/aria/cli/commands/service_templates.py ---------------------------------------------------------------------- diff --git a/aria/cli/commands/service_templates.py b/aria/cli/commands/service_templates.py index 823a6e8..af6252a 100644 --- a/aria/cli/commands/service_templates.py +++ b/aria/cli/commands/service_templates.py @@ -61,8 +61,9 @@ def show(service_template_id, model_storage, logger): columns = SERVICE_TEMPLATE_COLUMNS + ['#services'] print_data(columns, service_template_dict, 'Service-template:', max_width=50) - logger.info('Description:') - logger.info('{0}\n'.format(service_template_dict['description'].encode('UTF-8') or '')) + if service_template_dict['description'] is not None: + logger.info('Description:') + logger.info('{0}\n'.format(service_template_dict['description'].encode('UTF-8') or '')) logger.info('Existing services:') logger.info('{0}\n'.format(json.dumps([d['name'] for d in services])))