Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for latest bigip #252

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions f5_cccl/bigip.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,12 @@ def _refresh_net(self):
# our local list.
LOGGER.debug(
"Retrieving fdb tunnels from BIG-IP /%s...", self._partition)
# Adding support for latest bigips
self._bigip.tm.net.fdb.tunnels.raw['_meta_data']['icontrol_version'] = self._bigip.tmos_version
tunnels = self._bigip.tm.net.fdb.tunnels.get_collection()
for t in tunnels:
t.raw["_meta_data"]["icontrol_version"] = self._bigip.tmos_version


# Refresh the arp cache
self._arps = {
Expand All @@ -418,6 +423,7 @@ def _refresh_net(self):
for t in tunnels if (self._manageable_resource(t) and
t.partition == self._partition)
}

self._all_fdb_tunnels = {
t.name: self._create_resource(IcrFDBTunnel, t,
default_route_domain)
Expand Down
4 changes: 3 additions & 1 deletion f5_cccl/resource/net/fdb/tunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ def __hash__(self): # pylint: disable=useless-super-delegation
return super(FDBTunnel, self).__hash__()

def _uri_path(self, bigip):
return bigip.tm.net.fdb.tunnels.tunnel
t = bigip.tm.net.fdb.tunnels.tunnel
t.raw["_meta_data"]["icontrol_version"] = bigip.tmos_version
return t


class IcrFDBTunnel(FDBTunnel):
Expand Down
1 change: 1 addition & 0 deletions f5_cccl/resource/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ def update(self, bigip, data=None, modify=False):
name=urlquote(self.name),
partition=self.partition)
payload = copy.copy(data)
obj.raw['_meta_data']['icontrol_version'] = obj.raw['_meta_data']['creation_uri_qargs']['ver'][0]
if modify:
obj.modify(**payload)
else:
Expand Down
13 changes: 7 additions & 6 deletions f5_cccl/service/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,13 @@ def _get_user_tunnel_tasks(self, desired):
all_tunnels = self._bigip.get_fdb_tunnels(all_tunnels=True)
# Get only the tunnels we desire
update_list = set(desired) & set(all_tunnels)
update_list = [
desired[resource] for resource in update_list
if desired[resource] != all_tunnels[resource]
]

return update_list
new_list = []
for resource in update_list:
if desired[resource] != all_tunnels[resource]:
new_list.append(desired[resource])
LOGGER.info(desired[resource])
LOGGER.info(all_tunnels[resource])
return new_list

# pylint: disable=too-many-locals
def _desired_nodes(self, default_route_domain):
Expand Down