From 6e3fd87340e7225a6e2d5987efb8462056384524 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Thu, 10 Oct 2019 15:49:55 -0400 Subject: [PATCH] Return empty list instead of None for tags If a stack has no tags, return an empty list [] instead of None for its tags list. Change-Id: I3c3c083d7261172d08b933de7c63b6a489ed6ccd Depends-On: https://review.opendev.org/687769 Task: 37009 --- heat/engine/api.py | 2 +- heat/tests/test_engine_api_utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/heat/engine/api.py b/heat/engine/api.py index 5ad560faa5..ddffaa2565 100644 --- a/heat/engine/api.py +++ b/heat/engine/api.py @@ -221,7 +221,7 @@ def format_stack(stack, preview=False, resolve_outputs=True): rpc_api.STACK_OWNER: stack.username, rpc_api.STACK_PARENT: stack.owner_id, rpc_api.STACK_USER_PROJECT_ID: stack.stack_user_project_id, - rpc_api.STACK_TAGS: stack.tags or None, + rpc_api.STACK_TAGS: stack.tags, } if not preview: diff --git a/heat/tests/test_engine_api_utils.py b/heat/tests/test_engine_api_utils.py index f21687da11..44a0731572 100644 --- a/heat/tests/test_engine_api_utils.py +++ b/heat/tests/test_engine_api_utils.py @@ -398,7 +398,7 @@ class FormatTest(common.HeatTestCase): 'outputs': [], 'template_description': 'No description', 'timeout_mins': None, - 'tags': None, + 'tags': [], 'parameters': { 'AWS::Region': 'ap-southeast-1', 'AWS::StackId': aws_id,