Skip to content

Commit 2c081ea

Browse files
author
pjbreaux
authored
Merge pull request #516 from zancas/bugfix.tunnels_is_a_collection_515
TunnelS --> back to --> Tunnels_s
2 parents 81e35af + 47a0c60 commit 2c081ea

3 files changed

Lines changed: 13 additions & 14 deletions

File tree

f5/bigip/tm/net/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from f5.bigip.tm.net.route import Routes
3636
from f5.bigip.tm.net.route_domain import Route_Domains
3737
from f5.bigip.tm.net.selfip import Selfips
38-
from f5.bigip.tm.net.tunnels import TunnelS
38+
from f5.bigip.tm.net.tunnels import Tunnels_s
3939
from f5.bigip.tm.net.vlan import Vlans
4040

4141

@@ -50,6 +50,6 @@ def __init__(self, tm):
5050
Routes,
5151
Route_Domains,
5252
Selfips,
53-
TunnelS,
53+
Tunnels_s,
5454
Vlans
5555
]

f5/bigip/tm/net/tunnels.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,13 @@
2828
"""
2929

3030
from f5.bigip.resource import Collection
31-
from f5.bigip.resource import OrganizingCollection
3231
from f5.bigip.resource import Resource
3332

3433

35-
class TunnelS(OrganizingCollection):
34+
class Tunnels_s(Collection):
3635
"""BIG-IP® network tunnels collection"""
3736
def __init__(self, net):
38-
super(TunnelS, self).__init__(net)
37+
super(Tunnels_s, self).__init__(net)
3938
self._meta_data['allowed_lazy_attributes'] = [
4039
Gres,
4140
Tunnels,
@@ -45,8 +44,8 @@ def __init__(self, net):
4544

4645
class Tunnels(Collection):
4746
"""BIG-IP® network tunnels resource (collection for GRE, Tunnel, VXLANs"""
48-
def __init__(self, tunnels):
49-
super(Tunnels, self).__init__(tunnels)
47+
def __init__(self, tunnels_s):
48+
super(Tunnels, self).__init__(tunnels_s)
5049
self._meta_data['allowed_lazy_attributes'] = [Gres, Tunnel, Vxlans]
5150
self._meta_data['attribute_registry'] =\
5251
{'tm:net:tunnels:tunnel:tunnelstate': Tunnel}

test/functional/tm/net/test_tunnels.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def teardown():
3232
delete_resource(tunnel)
3333
request.addfinalizer(teardown)
3434

35-
tunnel = bigip.net.tunnels.tunnels.tunnel.create(
35+
tunnel = bigip.net.tunnels_s.tunnels.tunnel.create(
3636
name=name, partition=partition, localAddress=ip, profile=profile)
3737
return tunnel
3838

@@ -42,7 +42,7 @@ def teardown():
4242
delete_resource(gre)
4343
request.addfinalizer(teardown)
4444

45-
gre = bigip.net.tunnels.gres.gre.create(
45+
gre = bigip.net.tunnels_s.gres.gre.create(
4646
name=name, partition=partition)
4747
return gre
4848

@@ -52,14 +52,14 @@ def teardown():
5252
delete_resource(vxlan)
5353
request.addfinalizer(teardown)
5454

55-
vxlan = bigip.net.tunnels.vxlans.vxlan.create(
55+
vxlan = bigip.net.tunnels_s.vxlans.vxlan.create(
5656
name=name, partition=partition)
5757
return vxlan
5858

5959

6060
class TestTunnels(object):
6161
def test_tunnel_list(self, bigip):
62-
tunnels = bigip.net.tunnels.tunnels.get_collection()
62+
tunnels = bigip.net.tunnels_s.tunnels.get_collection()
6363
assert len(tunnels)
6464
for tunnel in tunnels:
6565
assert tunnel.generation
@@ -74,7 +74,7 @@ def test_tunnel_CURDL(self, request, bigip):
7474
)
7575

7676
# Load
77-
t2 = bigip.net.tunnels.tunnels.tunnel.load(
77+
t2 = bigip.net.tunnels_s.tunnels.tunnel.load(
7878
name='tunnel-test', partition='Common')
7979
assert t1.name == 'tunnel-test'
8080
assert t1.name == t2.name
@@ -99,7 +99,7 @@ def test_gre_CURDL(self, request, bigip):
9999
assert g1.name == 'gre-test'
100100

101101
# Load
102-
g2 = bigip.net.tunnels.gres.gre.load(
102+
g2 = bigip.net.tunnels_s.gres.gre.load(
103103
name='gre-test', partition='Common')
104104
assert g1.name == g2.name
105105
assert g1.generation == g2.generation
@@ -123,7 +123,7 @@ def test_vxlan_CURDL(self, request, bigip):
123123
assert vx1.name == 'vxlan-test'
124124

125125
# Load
126-
vx2 = bigip.net.tunnels.vxlans.vxlan.load(
126+
vx2 = bigip.net.tunnels_s.vxlans.vxlan.load(
127127
name='vxlan-test', partition='Common')
128128
assert vx1.name == vx2.name
129129
assert vx1.generation == vx2.generation

0 commit comments

Comments
 (0)