NetApp ONTAP: allow multiple DNS IPs
The security service dns_ip parameter also takes a list of comma separated DNS IPs for vserver dns configuration. Allows HA setup, where DNS can be down for maintenance. Change-Id: I1da99d0b44778d3ccaaff5871dfcb175b8cdbc02
This commit is contained in:
parent
04aa4ba141
commit
192b4d128d
@ -21,7 +21,8 @@ types:
|
|||||||
|
|
||||||
You can configure a security service with these options:
|
You can configure a security service with these options:
|
||||||
|
|
||||||
- A DNS IP address.
|
- A DNS IP address. Some drivers may allow a comma separated list of multiple
|
||||||
|
addresses, e.g. NetApp ONTAP.
|
||||||
|
|
||||||
- An IP address or host name.
|
- An IP address or host name.
|
||||||
|
|
||||||
|
@ -1462,11 +1462,12 @@ class NetAppCmodeClient(client_base.NetAppBaseClient):
|
|||||||
'domains': {
|
'domains': {
|
||||||
'string': security_service['domain'],
|
'string': security_service['domain'],
|
||||||
},
|
},
|
||||||
'name-servers': {
|
'name-servers': [],
|
||||||
'ip-address': security_service['dns_ip'],
|
|
||||||
},
|
|
||||||
'dns-state': 'enabled',
|
'dns-state': 'enabled',
|
||||||
}
|
}
|
||||||
|
for dns_ip in security_service['dns_ip'].split(','):
|
||||||
|
api_args['name-servers'].append({'ip-address': dns_ip.strip()})
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.send_request('net-dns-create', api_args)
|
self.send_request('net-dns-create', api_args)
|
||||||
except netapp_api.NaApiError as e:
|
except netapp_api.NaApiError as e:
|
||||||
|
@ -2585,15 +2585,33 @@ class NetAppClientCmodeTestCase(test.TestCase):
|
|||||||
|
|
||||||
net_dns_create_args = {
|
net_dns_create_args = {
|
||||||
'domains': {'string': fake.CIFS_SECURITY_SERVICE['domain']},
|
'domains': {'string': fake.CIFS_SECURITY_SERVICE['domain']},
|
||||||
'name-servers': {
|
'name-servers': [{
|
||||||
'ip-address': fake.CIFS_SECURITY_SERVICE['dns_ip']
|
'ip-address': fake.CIFS_SECURITY_SERVICE['dns_ip']
|
||||||
},
|
}],
|
||||||
'dns-state': 'enabled'
|
'dns-state': 'enabled'
|
||||||
}
|
}
|
||||||
|
|
||||||
self.client.send_request.assert_has_calls([
|
self.client.send_request.assert_has_calls([
|
||||||
mock.call('net-dns-create', net_dns_create_args)])
|
mock.call('net-dns-create', net_dns_create_args)])
|
||||||
|
|
||||||
|
def test_configure_dns_multiple_dns_ip(self):
|
||||||
|
|
||||||
|
self.mock_object(self.client, 'send_request')
|
||||||
|
mock_dns_ips = ['10.0.0.1', '10.0.0.2', '10.0.0.3']
|
||||||
|
security_service = fake.CIFS_SECURITY_SERVICE
|
||||||
|
security_service['dns_ip'] = ', '.join(mock_dns_ips)
|
||||||
|
|
||||||
|
self.client.configure_dns(security_service)
|
||||||
|
|
||||||
|
net_dns_create_args = {
|
||||||
|
'domains': {'string': security_service['domain']},
|
||||||
|
'dns-state': 'enabled',
|
||||||
|
'name-servers': [{'ip-address': dns_ip} for dns_ip in mock_dns_ips]
|
||||||
|
}
|
||||||
|
|
||||||
|
self.client.send_request.assert_has_calls([
|
||||||
|
mock.call('net-dns-create', net_dns_create_args)])
|
||||||
|
|
||||||
def test_configure_dns_for_kerberos(self):
|
def test_configure_dns_for_kerberos(self):
|
||||||
|
|
||||||
self.mock_object(self.client, 'send_request')
|
self.mock_object(self.client, 'send_request')
|
||||||
@ -2602,9 +2620,9 @@ class NetAppClientCmodeTestCase(test.TestCase):
|
|||||||
|
|
||||||
net_dns_create_args = {
|
net_dns_create_args = {
|
||||||
'domains': {'string': fake.KERBEROS_SECURITY_SERVICE['domain']},
|
'domains': {'string': fake.KERBEROS_SECURITY_SERVICE['domain']},
|
||||||
'name-servers': {
|
'name-servers': [{
|
||||||
'ip-address': fake.KERBEROS_SECURITY_SERVICE['dns_ip']
|
'ip-address': fake.KERBEROS_SECURITY_SERVICE['dns_ip']
|
||||||
},
|
}],
|
||||||
'dns-state': 'enabled'
|
'dns-state': 'enabled'
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2621,9 +2639,9 @@ class NetAppClientCmodeTestCase(test.TestCase):
|
|||||||
|
|
||||||
net_dns_create_args = {
|
net_dns_create_args = {
|
||||||
'domains': {'string': fake.KERBEROS_SECURITY_SERVICE['domain']},
|
'domains': {'string': fake.KERBEROS_SECURITY_SERVICE['domain']},
|
||||||
'name-servers': {
|
'name-servers': [{
|
||||||
'ip-address': fake.KERBEROS_SECURITY_SERVICE['dns_ip']
|
'ip-address': fake.KERBEROS_SECURITY_SERVICE['dns_ip']
|
||||||
},
|
}],
|
||||||
'dns-state': 'enabled'
|
'dns-state': 'enabled'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The NetApp ONTAP driver security service dns_ip parameter also takes a list
|
||||||
|
of comma separated DNS IPs for vserver dns configuration. Allows HA setup,
|
||||||
|
where DNS can be down for maintenance.
|
Loading…
Reference in New Issue
Block a user