From 5424d11202506a26ba235e6c78e0398d9fc14bf4 Mon Sep 17 00:00:00 2001 From: Hiroyasu OHYAMA Date: Thu, 21 Feb 2019 18:19:05 +0900 Subject: [PATCH] Changed to able to get/update 'aliases' parameter of HOST record for DNS (#213) LGTM --- AUTHORS.rst | 1 + infoblox_client/objects.py | 9 +++++---- tests/test_objects.py | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index 1df8da1f..bdb9f28e 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -16,5 +16,6 @@ Contributors * Robert Grant * Yakau Bubnou * Jonas Krüger Svensson +* Hiroyasu OHYAMA More are always welcome! diff --git a/infoblox_client/objects.py b/infoblox_client/objects.py index 0648795b..2904ab0a 100644 --- a/infoblox_client/objects.py +++ b/infoblox_client/objects.py @@ -555,13 +555,13 @@ class HostRecordV4(HostRecord): """HostRecord for IPv4""" _fields = ['ipv4addrs', 'view', 'extattrs', 'name', 'zone', 'configure_for_dns', 'network_view', 'mac', 'ttl', - 'comment'] + 'comment', 'aliases'] _search_for_update_fields = ['view', 'ipv4addr', 'name', 'zone', 'network_view', 'mac'] _all_searchable_fields = _search_for_update_fields _updateable_search_fields = ['name'] _shadow_fields = ['_ref', 'ipv4addr'] - _return_fields = ['ipv4addrs', 'extattrs'] + _return_fields = ['ipv4addrs', 'extattrs', 'aliases'] _remap = {'ip': 'ipv4addrs', 'ips': 'ipv4addrs'} _ip_version = 4 @@ -590,13 +590,14 @@ def _build_ipv4(ips_v4): class HostRecordV6(HostRecord): """HostRecord for IPv6""" _fields = ['ipv6addrs', 'view', 'extattrs', 'name', 'zone', - 'configure_for_dns', 'network_view', 'ttl', 'comment'] + 'configure_for_dns', 'network_view', 'ttl', 'comment', + 'aliases'] _search_for_update_fields = ['ipv6addr', 'view', 'name', 'zone', 'network_view'] _all_searchable_fields = _search_for_update_fields _updateable_search_fields = ['name'] _shadow_fields = ['_ref', 'ipv6addr'] - _return_fields = ['ipv6addrs', 'extattrs'] + _return_fields = ['ipv6addrs', 'extattrs', 'aliases'] _remap = {'ip': 'ipv6addrs', 'ips': 'ipv6addrs'} diff --git a/tests/test_objects.py b/tests/test_objects.py index d374b3c3..f658d8c6 100644 --- a/tests/test_objects.py +++ b/tests/test_objects.py @@ -135,7 +135,7 @@ def test_create_host_record_with_ttl(self): {'mac': 'fa:16:3e:29:87:70', 'ipv4addr': '22.0.0.2'}], 'view': 'some-dns-view'}, - ['ipv4addrs', 'extattrs']) + ['ipv4addrs', 'extattrs', 'aliases']) def test_create_host_record_with_ip(self): mock_record = DEFAULT_HOST_RECORD