From ce4cc51625a2fd7df7960f455538be54cb57e8a4 Mon Sep 17 00:00:00 2001 From: Dongfeng Huang Date: Mon, 24 Jul 2017 15:57:48 +0800 Subject: [PATCH] Add some available resource types 1. What is the problem Some resources are needed by asynchronous job, as described in [1], 'trunk_id' and 'portchain_id' are needed when create a job. So we need to add these resources to allow resource routings creation. Besides resources 'trunk_id' and 'portchain_id', other resources are also needed in the tricircle, therefore all needed resources are added at once by this patch. This problem also exists in the tricircle, and it's fixed by patch [2]. 2. What is the solution for the problem Add some resource types to allow for resource routing creation. 3. What the features need to be implemented to the tricircleclient to realize the solution None. [1] https://github.com/openstack/tricircle/blob/master/tricircle/common/constants.py#L130 [2] https://review.openstack.org/#/c/486364 Change-Id: I75c2ed6b16a2a15ae4c4cc1756f0cb730df90f08 --- tox.ini | 2 +- tricircleclient/v1/routings_cli.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 0a8c35e..1c4bc14 100644 --- a/tox.ini +++ b/tox.ini @@ -37,7 +37,7 @@ commands = {posargs} [testenv:cover] commands = python setup.py test --coverage --testr-args='{posargs}' - coverage report --fail-under=81 --skip-covered + coverage report --fail-under=83 --skip-covered [testenv:docs] deps = .[test,doc] diff --git a/tricircleclient/v1/routings_cli.py b/tricircleclient/v1/routings_cli.py index 725f581..5cbd762 100644 --- a/tricircleclient/v1/routings_cli.py +++ b/tricircleclient/v1/routings_cli.py @@ -77,7 +77,9 @@ def _add_filtering_arguments(parser): parser.add_argument( '--resource-type', dest='resource_type', metavar='resource_type', type=str, - choices=['network', 'subnet', 'port', 'router', 'security_group'], + choices=['network', 'subnet', 'port', 'router', 'security_group', + 'trunk', 'port_pair', 'port_pair_group', 'flow_classifier', + 'port_chain'], help="Available resource types", default=None) parser.add_argument(