From 204ec8f9ffe2b9899e7176e154dc9d2140af8537 Mon Sep 17 00:00:00 2001 From: Daniel Carrillo Date: Fri, 19 Feb 2021 17:46:04 +0100 Subject: [PATCH] Return an empty array when there is no data for json output --- digaws/__init__.py | 2 +- digaws/digaws.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/digaws/__init__.py b/digaws/__init__.py index 04d93c0..74fc766 100644 --- a/digaws/__init__.py +++ b/digaws/__init__.py @@ -1,2 +1,2 @@ -__version__ = '1.0.3' +__version__ = '1.0.4' __description__ = 'Look up canonical information for AWS IP addresses and networks' diff --git a/digaws/digaws.py b/digaws/digaws.py index 8ed391f..6d0e511 100755 --- a/digaws/digaws.py +++ b/digaws/digaws.py @@ -127,8 +127,7 @@ class DigAWSPrettyPrinter: item_dict.update({'network_border_group': prefix['network_border_group']}) data.append(item_dict) - if data: - print(json.dumps(data, indent=2)) + print(json.dumps(data, indent=2)) class DigAWS():