F5Networks / f5-common-python

Python SDK for configuration and monitoring of F5® BIG-IP® devices via the iControl® REST API.
https://f5-sdk.readthedocs.org
Apache License 2.0
262 stars 134 forks source link

RFE: Support for specifying auth token to use #1510

Open jbnance opened 6 years ago

jbnance commented 6 years ago

ICR added the ability to specify the auth token to use in https://github.com/F5Networks/f5-icontrol-rest-python/pull/138.

Please add support for this parameter to the SDK.

Using:

f5-icontrol-rest==1.3.11
f5-sdk==3.0.20

I get the following:

mgmt = ManagementRoot(
    hostname,
    username,
    password,
    token=True,
    token_to_use='my_big_token_from_another_connection',
)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../f5env/lib/python3.6/site-packages/f5/bigip/__init__.py", line 169, in __init__
    hostname, username, password, **kwargs
  File ".../f5env/lib/python3.6/site-packages/f5/bigip/__init__.py", line 55, in __init__
    hostname, username, password, **kwargs
  File ".../f5env/lib/python3.6/site-packages/f5/bigip/__init__.py", line 72, in parse_arguments
    raise TypeError('Unexpected **kwargs: %r' % kwargs)
TypeError: Unexpected **kwargs: {'token_to_use': 'my_big_token_from_another_connection'}
jbnance commented 6 years ago

PR #1511 added to try and get this rolling