From 29ad7fa376071dd775072387c1cc76be61688e81 Mon Sep 17 00:00:00 2001 From: Andrew Gauld Date: Thu, 5 Sep 2019 13:04:52 +0000 Subject: Make format_description handle None Change-Id: I81f3158bca00ae78ba5f2ea733c09ffd3758bbe0 Issue-ID: DCAEGEN2-1723 Signed-off-by: Andrew Gauld --- dcae-cli/ChangeLog.md | 3 +++ dcae-cli/dcae_cli/_version.py | 2 +- dcae-cli/dcae_cli/commands/util.py | 2 ++ dcae-cli/pom.xml | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dcae-cli/ChangeLog.md b/dcae-cli/ChangeLog.md index 707e9a8..0780df4 100644 --- a/dcae-cli/ChangeLog.md +++ b/dcae-cli/ChangeLog.md @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [2.11.4] + +* Fix format_description to handle no description case ## [2.11.3] * Fix Format class definition of "description" to match JSON schema diff --git a/dcae-cli/dcae_cli/_version.py b/dcae-cli/dcae_cli/_version.py index 5f3d51b..5c4f3cc 100644 --- a/dcae-cli/dcae_cli/_version.py +++ b/dcae-cli/dcae_cli/_version.py @@ -19,4 +19,4 @@ # ECOMP is a trademark and service mark of AT&T Intellectual Property. # -*- coding: utf-8 -*- -__version__ = "2.11.3" +__version__ = "2.11.4" diff --git a/dcae-cli/dcae_cli/commands/util.py b/dcae-cli/dcae_cli/commands/util.py index 9f758e2..bc0fea3 100644 --- a/dcae-cli/dcae_cli/commands/util.py +++ b/dcae-cli/dcae_cli/commands/util.py @@ -80,6 +80,8 @@ def format_description(description, line_width=50, num_lines=3): of lines. The last line trails with ".." if the text still overflows to signal that there is more. """ + if not description: + return '' lines = textwrap.wrap(description) lines = lines[:num_lines] last_line = lines.pop() diff --git a/dcae-cli/pom.xml b/dcae-cli/pom.xml index bfc1b6f..7d19044 100644 --- a/dcae-cli/pom.xml +++ b/dcae-cli/pom.xml @@ -27,7 +27,7 @@ limitations under the License. org.onap.dcaegen2.platform.cli dcae-cli dcaegen2-platform-cli-dcae-cli - 2.11.3 + 2.11.4 http://maven.apache.org UTF-8 -- cgit 1.2.3-korg