From 2c67978ec98052ee9af5ad5046734612796dee74 Mon Sep 17 00:00:00 2001 From: jonnary Date: Tue, 15 Nov 2016 18:28:04 +0800 Subject: [PATCH] Add "cluster_id" column to `openstack cluster event list` 'cluster_id' is a supported filters key, we'd better to show 'cluster_id' to help set 'cluster_id' filters key value. This patch adds "cluster_id" column to `openstack cluster event list` Also, we remove "status_reason" column to avoid too wide in a line. Closes-Bug: #1641900 Change-Id: Iec86b8fe3a967d222a82ca946f1f013f08412e66 --- senlinclient/tests/unit/v1/test_event.py | 6 +++--- senlinclient/v1/event.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/senlinclient/tests/unit/v1/test_event.py b/senlinclient/tests/unit/v1/test_event.py index 63df5bb..30821ec 100644 --- a/senlinclient/tests/unit/v1/test_event.py +++ b/senlinclient/tests/unit/v1/test_event.py @@ -30,7 +30,7 @@ class TestEvent(fakes.TestClusteringv1): class TestEventList(TestEvent): columns = ['id', 'generated_at', 'obj_type', 'obj_id', 'obj_name', - 'action', 'status', 'status_reason', 'level'] + 'action', 'status', 'level', 'cluster_id'] response = {"events": [ { @@ -43,7 +43,7 @@ class TestEventList(TestEvent): "obj_type": "NODE", "project": "6e18cc2bdbeb48a5b3cad2dc499f6804", "status": "CREATING", - "status_reason": "Initializing", + "cluster_id": "f23ff00c-ec4f-412d-bd42-7f6e209819cb", "generated_at": "2015-03-05T08:53:15", "user": "a21ded6060534d99840658a777c2af5a" } @@ -144,7 +144,7 @@ class TestEventShow(TestEvent): "obj_type": "NODE", "project": "6e18cc2bdbeb48a5b3cad2dc499f6804", "status": "CREATING", - "status_reason": "Initializing", + "cluster_id": "f23ff00c-ec4f-412d-bd42-7f6e209819cb", "generated_at": "2015-03-05T08:53:15", "user": "a21ded6060534d99840658a777c2af5a" }} diff --git a/senlinclient/v1/event.py b/senlinclient/v1/event.py index 3c1cc1c..8d8de08 100644 --- a/senlinclient/v1/event.py +++ b/senlinclient/v1/event.py @@ -80,7 +80,7 @@ class ListEvent(command.Lister): senlin_client = self.app.client_manager.clustering columns = ['id', 'generated_at', 'obj_type', 'obj_id', 'obj_name', - 'action', 'status', 'status_reason', 'level'] + 'action', 'status', 'level', 'cluster_id'] queries = { 'sort': parsed_args.sort, 'limit': parsed_args.limit,