community.general/lib/ansible/module_utils/network/f5/bigip/common.py
Tim Rupp e4abb0de33
A first pass at moving libs to new dir structure (#33727)
* A first pass at moving libs to new dir structure

The network modules changed their module_utils dir structure.
This first patch establishes mod utils for F5 in this new structure.

Module use will be limited until things are more fleshed out

* Fixing upstream errors

* Fixing more issues
2017-12-08 15:28:23 -08:00

28 lines
881 B
Python

# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
try:
from f5.bigip import ManagementRoot as BigipManagementRoot
from f5.bigip.contexts import TransactionContextManager as BigipTransactionContextManager
from f5.bigiq import ManagementRoot as BigiqManagementRoot
from f5.iworkflow import ManagementRoot as IworkflowManagementRoot
from icontrol.exceptions import iControlUnexpectedHTTPError
HAS_F5SDK = True
except ImportError:
HAS_F5SDK = False
def cleanup_tokens(client):
try:
resource = client.api.shared.authz.tokens_s.token.load(
name=client.api.icrs.token
)
resource.delete()
except Exception:
pass