From f305b53831d5e1a922005a6582e4a8c51b4266b3 Mon Sep 17 00:00:00 2001 From: zhiyuan_cai Date: Wed, 22 Nov 2017 16:31:34 +0800 Subject: [PATCH] Remove duplicated code in helper.py 1. What is the problem? We have some duplicated code in helper.py 2. What is the solution to the problem? Remove the duplicated code 3. What features need to be implemented to the Tricircle to realize the solution? N/A Change-Id: I5dc8a09cbaac55d35605ea0f960ec6f362482c71 Closes-Bug: #1733795 --- tricircle/network/helper.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tricircle/network/helper.py b/tricircle/network/helper.py index 9b5b9b92..139edb52 100644 --- a/tricircle/network/helper.py +++ b/tricircle/network/helper.py @@ -244,9 +244,6 @@ class NetworkHelper(object): value = t_constants.shadow_port_name % ele_['id'] elif _type_ == t_constants.RT_NETWORK: value = utils.get_bottom_network_name(ele_) - elif _type_ == t_constants.RT_SD_PORT: - _type_ = t_constants.RT_PORT - value = t_constants.shadow_port_name % ele_['id'] else: value = ele_['id'] return client.list_resources(_type_, t_ctx_, @@ -259,8 +256,6 @@ class NetworkHelper(object): elif _type_ == t_constants.RT_SD_PORT: _type_ = t_constants.RT_PORT client = self._get_client(pod_['region_name']) - if _type_ == t_constants.RT_SD_PORT: - _type_ = t_constants.RT_PORT return client.create_resources(_type_, t_ctx_, body_) return t_lock.get_or_create_element(