From 80ad69eba03812305e58a16c607998e050a83788 Mon Sep 17 00:00:00 2001 From: sammcgeown Date: Tue, 17 Dec 2019 12:22:29 +0000 Subject: [PATCH] Modify blueprint.list to return an empty list to fix #4 --- .gitignore | 5 ++++- caspyr/blueprint.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 4671550..b7037cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ .vscode __pycache__ -*.pyc \ No newline at end of file +*.pyc +build +caspyr.egg-info +dist diff --git a/caspyr/blueprint.py b/caspyr/blueprint.py index e58f6fd..be11b16 100644 --- a/caspyr/blueprint.py +++ b/caspyr/blueprint.py @@ -58,7 +58,9 @@ def list(session): uri = '/blueprint/api/blueprints/' j = session._request(f'{session.baseurl}{uri}') - return j['objects'] + if 'objects' in j: + return j['objects'] + return [] @classmethod def describe(cls, session, blueprint_id):