From 18921395b66493308fd61f47bed8701463b98114 Mon Sep 17 00:00:00 2001 From: Nicholas Morsman Date: Wed, 29 Jun 2016 14:12:50 +0200 Subject: [PATCH] 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 --- .../extras/database/influxdb/influxdb_retention_policy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/database/influxdb/influxdb_retention_policy.py b/lib/ansible/modules/extras/database/influxdb/influxdb_retention_policy.py index 4f960003bc..ec4c32da21 100644 --- a/lib/ansible/modules/extras/database/influxdb/influxdb_retention_policy.py +++ b/lib/ansible/modules/extras/database/influxdb/influxdb_retention_policy.py @@ -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: