Skip to content

Commit

Permalink
Merge pull request #545 from zancas/bugfix_tunnels_544
Browse files Browse the repository at this point in the history
Fix tunnels_s --> tunnels bug
  • Loading branch information
pjbreaux authored Jul 9, 2016
2 parents f898e44 + 8c92d9b commit a800e30
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions f5/bigip/tm/net/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from f5.bigip.tm.net.route import Routes
from f5.bigip.tm.net.route_domain import Route_Domains
from f5.bigip.tm.net.selfip import Selfips
from f5.bigip.tm.net.tunnels import Tunnels_s
from f5.bigip.tm.net.tunnels import TunnelS
from f5.bigip.tm.net.vlan import Vlans


Expand All @@ -50,6 +50,6 @@ def __init__(self, tm):
Routes,
Route_Domains,
Selfips,
Tunnels_s,
TunnelS,
Vlans
]
9 changes: 5 additions & 4 deletions f5/bigip/tm/net/tunnels.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@
"""

from f5.bigip.resource import Collection
from f5.bigip.resource import OrganizingCollection
from f5.bigip.resource import Resource


class Tunnels_s(Collection):
class TunnelS(OrganizingCollection):
"""BIG-IP® network tunnels collection"""
def __init__(self, net):
super(Tunnels_s, self).__init__(net)
super(TunnelS, self).__init__(net)
self._meta_data['allowed_lazy_attributes'] = [
Gres,
Tunnels,
Expand All @@ -44,8 +45,8 @@ def __init__(self, net):

class Tunnels(Collection):
"""BIG-IP® network tunnels resource (collection for GRE, Tunnel, VXLANs"""
def __init__(self, tunnels_s):
super(Tunnels, self).__init__(tunnels_s)
def __init__(self, tunnelS):
super(Tunnels, self).__init__(tunnelS)
self._meta_data['allowed_lazy_attributes'] = [Gres, Tunnel, Vxlans]
self._meta_data['attribute_registry'] =\
{'tm:net:tunnels:tunnel:tunnelstate': Tunnel}
Expand Down
14 changes: 7 additions & 7 deletions test/functional/tm/net/test_tunnels.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def teardown():
delete_resource(tunnel)
request.addfinalizer(teardown)

tunnel = bigip.net.tunnels_s.tunnels.tunnel.create(
tunnel = bigip.net.tunnels.tunnels.tunnel.create(
name=name, partition=partition, localAddress=ip, profile=profile)
return tunnel

Expand All @@ -42,7 +42,7 @@ def teardown():
delete_resource(gre)
request.addfinalizer(teardown)

gre = bigip.net.tunnels_s.gres.gre.create(
gre = bigip.net.tunnels.gres.gre.create(
name=name, partition=partition)
return gre

Expand All @@ -52,14 +52,14 @@ def teardown():
delete_resource(vxlan)
request.addfinalizer(teardown)

vxlan = bigip.net.tunnels_s.vxlans.vxlan.create(
vxlan = bigip.net.tunnels.vxlans.vxlan.create(
name=name, partition=partition)
return vxlan


class TestTunnels(object):
def test_tunnel_list(self, bigip):
tunnels = bigip.net.tunnels_s.tunnels.get_collection()
tunnels = bigip.net.tunnels.tunnels.get_collection()
assert len(tunnels)
for tunnel in tunnels:
assert tunnel.generation
Expand All @@ -74,7 +74,7 @@ def test_tunnel_CURDL(self, request, bigip):
)

# Load
t2 = bigip.net.tunnels_s.tunnels.tunnel.load(
t2 = bigip.net.tunnels.tunnels.tunnel.load(
name='tunnel-test', partition='Common')
assert t1.name == 'tunnel-test'
assert t1.name == t2.name
Expand All @@ -99,7 +99,7 @@ def test_gre_CURDL(self, request, bigip):
assert g1.name == 'gre-test'

# Load
g2 = bigip.net.tunnels_s.gres.gre.load(
g2 = bigip.net.tunnels.gres.gre.load(
name='gre-test', partition='Common')
assert g1.name == g2.name
assert g1.generation == g2.generation
Expand All @@ -123,7 +123,7 @@ def test_vxlan_CURDL(self, request, bigip):
assert vx1.name == 'vxlan-test'

# Load
vx2 = bigip.net.tunnels_s.vxlans.vxlan.load(
vx2 = bigip.net.tunnels.vxlans.vxlan.load(
name='vxlan-test', partition='Common')
assert vx1.name == vx2.name
assert vx1.generation == vx2.generation
Expand Down

0 comments on commit a800e30

Please sign in to comment.