mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
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:
commit
ad9e3a0006
1 changed files with 5 additions and 3 deletions
|
@ -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']:
|
||||
|
|
Loading…
Add table
Reference in a new issue