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
This commit is contained in:
zhiyuan_cai 2017-11-22 16:31:34 +08:00
parent 890d2901ab
commit f305b53831
1 changed files with 0 additions and 5 deletions

View File

@ -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(