Bugfix influxdb/retention_policy: infinite retention is returned as 0 (#2453)

* influxdb: retention_policy: infinite retention is returned as 0 from influxdb

* influxdb: retention_policy: database_name argument should be required
pull/18777/head
Nicholas Morsman 8 years ago committed by Matt Clay
parent a9e3b6aa05
commit 18921395b6

@ -125,7 +125,7 @@ def influxdb_argument_spec():
port=dict(default=8086, type='int'),
username=dict(default='root', type='str'),
password=dict(default='root', type='str', no_log=True),
database_name=dict(default=None, type='str')
database_name=dict(required=True, type='str')
)
@ -195,7 +195,7 @@ def alter_retention_policy(module, client, retention_policy):
elif duration_lookup.group(2) == 'w':
influxdb_duration_format = '%sh0m0s' % (int(duration_lookup.group(1)) * 24 * 7)
elif duration == 'INF':
influxdb_duration_format = 'INF'
influxdb_duration_format = '0'
if not retention_policy['duration'] == influxdb_duration_format or not retention_policy['replicaN'] == int(replication) or not retention_policy['default'] == default:
if not module.check_mode:

Loading…
Cancel
Save