mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
influxdb: fix conflicts in function arg names with client_args
Rename client_args names so that it won't conflict anymore with some named parameters of influx module function. For example, the "create_user" function had a "password" argument that was conflicting with the "password" named argument from client_args.
This commit is contained in:
parent
73a24b774a
commit
7e7ae8ace7
1 changed files with 13 additions and 13 deletions
|
@ -58,22 +58,22 @@ def __virtual__():
|
|||
'influxdb library not available.'))
|
||||
|
||||
|
||||
def _client(user=None, password=None, host=None, port=None, **client_args):
|
||||
if not user:
|
||||
user = __salt__['config.option']('influxdb.user', 'root')
|
||||
if not password:
|
||||
password = __salt__['config.option']('influxdb.password', 'root')
|
||||
if not host:
|
||||
host = __salt__['config.option']('influxdb.host', 'localhost')
|
||||
if not port:
|
||||
port = __salt__['config.option']('influxdb.port', 8086)
|
||||
def _client(influxdb_user=None, influxdb_password=None, influxdb_host=None, influxdb_port=None, **client_args):
|
||||
if not influxdb_user:
|
||||
influxdb_user = __salt__['config.option']('influxdb.user', 'root')
|
||||
if not influxdb_password:
|
||||
influxdb_password = __salt__['config.option']('influxdb.password', 'root')
|
||||
if not influxdb_host:
|
||||
influxdb_host = __salt__['config.option']('influxdb.host', 'localhost')
|
||||
if not influxdb_port:
|
||||
influxdb_port = __salt__['config.option']('influxdb.port', 8086)
|
||||
for ignore in _STATE_INTERNAL_KEYWORDS:
|
||||
if ignore in client_args:
|
||||
del client_args[ignore]
|
||||
return influxdb.InfluxDBClient(host=host,
|
||||
port=port,
|
||||
username=user,
|
||||
password=password,
|
||||
return influxdb.InfluxDBClient(host=influxdb_host,
|
||||
port=influxdb_port,
|
||||
username=influxdb_user,
|
||||
password=influxdb_password,
|
||||
**client_args)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue