summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gauld <agauld@att.com>2019-09-05 13:04:52 +0000
committerAndrew Gauld <agauld@att.com>2019-09-05 14:34:07 +0000
commit29ad7fa376071dd775072387c1cc76be61688e81 (patch)
tree99122609dda2fc6b9c9b0099dcbc085796f998d6
parent85fe98b96d6097369a107b7df79f75c0c2a10bc0 (diff)
Make format_description handle None
Change-Id: I81f3158bca00ae78ba5f2ea733c09ffd3758bbe0 Issue-ID: DCAEGEN2-1723 Signed-off-by: Andrew Gauld <agauld@att.com>
-rw-r--r--dcae-cli/ChangeLog.md3
-rw-r--r--dcae-cli/dcae_cli/_version.py2
-rw-r--r--dcae-cli/dcae_cli/commands/util.py2
-rw-r--r--dcae-cli/pom.xml2
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.
<groupId>org.onap.dcaegen2.platform.cli</groupId>
<artifactId>dcae-cli</artifactId>
<name>dcaegen2-platform-cli-dcae-cli</name>
- <version>2.11.3</version>
+ <version>2.11.4</version>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>