mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Removes more f5-sdk references from f5 modules (#48771)
This commit is contained in:
parent
4771ccc24b
commit
a4921cd5d9
2 changed files with 44 additions and 53 deletions
|
@ -7,15 +7,6 @@ from __future__ import absolute_import, division, print_function
|
|||
__metaclass__ = type
|
||||
|
||||
|
||||
import re
|
||||
|
||||
try:
|
||||
from f5.bigip import ManagementRoot
|
||||
from icontrol.exceptions import iControlUnexpectedHTTPError
|
||||
HAS_F5SDK = True
|
||||
except ImportError:
|
||||
HAS_F5SDK = False
|
||||
|
||||
try:
|
||||
from library.module_utils.network.f5.common import F5BaseClient
|
||||
from library.module_utils.network.f5.common import F5ModuleError
|
||||
|
@ -26,34 +17,6 @@ except ImportError:
|
|||
from ansible.module_utils.network.f5.icontrol import iControlRestSession
|
||||
|
||||
|
||||
class F5Client(F5BaseClient):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(F5Client, self).__init__(*args, **kwargs)
|
||||
self.provider = self.merge_provider_params()
|
||||
|
||||
@property
|
||||
def api(self):
|
||||
if self._client:
|
||||
return self._client
|
||||
|
||||
try:
|
||||
result = ManagementRoot(
|
||||
self.provider['server'],
|
||||
self.provider['user'],
|
||||
self.provider['password'],
|
||||
port=self.provider['server_port'],
|
||||
verify=self.provider['validate_certs'],
|
||||
token='tmos'
|
||||
)
|
||||
self._client = result
|
||||
return self._client
|
||||
except Exception as ex:
|
||||
error = 'Unable to connect to {0} on port {1}. The reported error was "{2}".'.format(
|
||||
self.provider['server'], self.provider['server_port'], str(ex)
|
||||
)
|
||||
raise F5ModuleError(error)
|
||||
|
||||
|
||||
class F5RestClient(F5BaseClient):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(F5RestClient, self).__init__(*args, **kwargs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue