mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 20:01:25 -07:00
* 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
28 lines
881 B
Python
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
|