Merge pull request #38475 from bl4ckcontact/develop

Infoblox: Convert IP values to unicode, convert IP value to list for host records
This commit is contained in:
Mike Place 2017-01-01 13:39:12 -07:00 committed by GitHub
commit ad9e3a0006

View file

@ -10,6 +10,7 @@ from __future__ import absolute_import
# Import Python libs
import logging
from salt.ext import six
log = logging.getLogger(__name__)
@ -69,6 +70,7 @@ def present(name,
- sslVerify: False
'''
record_type = record_type.lower()
value_utf8 = six.text_type(value, "utf-8")
ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
records = __salt__['infoblox.get_record'](name,
record_type,
@ -83,13 +85,13 @@ def present(name,
for record in records:
update_record = False
if record_type == 'cname':
if record['Canonical Name'] != value:
if record['Canonical Name'] != value_utf8:
update_record = True
elif record_type == 'a':
if record['IP Address'] != value:
if record['IP Address'] != value_utf8:
update_record = True
elif record_type == 'host':
if record['IP Addresses'] != value:
if record['IP Addresses'] != [value_utf8]:
update_record = True
if update_record:
if __opts__['test']: