mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-05-07 13:53:15 +00:00
Enable update for recordset and add tests for dns and recordset module
Update for recordset wasn't working properly and there are no tests for dns and recordset modules, minor fix in dns_zone Change-Id: I7f78f6038dfb858e795b1954eae11cff47f697ad
This commit is contained in:
committed by
Shnaidman Sagi (Sergey)
parent
c532560d1b
commit
87c305907e
@@ -173,12 +173,24 @@ class DnsZoneModule(OpenStackModule):
|
||||
zone = self.conn.get_zone(name)
|
||||
|
||||
if state == 'present':
|
||||
|
||||
zone_type = self.params['zone_type']
|
||||
email = self.params['email']
|
||||
description = self.params['description']
|
||||
ttl = self.params['ttl']
|
||||
masters = self.params['masters']
|
||||
|
||||
kwargs = {}
|
||||
|
||||
if email:
|
||||
kwargs['email'] = email
|
||||
if description:
|
||||
kwargs['description'] = description
|
||||
if ttl:
|
||||
kwargs['ttl'] = ttl
|
||||
if masters:
|
||||
kwargs['masters'] = masters
|
||||
|
||||
if self.ansible.check_mode:
|
||||
self.exit_json(changed=self._system_state_change(state, email,
|
||||
description, ttl,
|
||||
@@ -186,8 +198,7 @@ class DnsZoneModule(OpenStackModule):
|
||||
|
||||
if zone is None:
|
||||
zone = self.conn.create_zone(
|
||||
name=name, zone_type=zone_type, email=email,
|
||||
description=description, ttl=ttl, masters=masters)
|
||||
name=name, zone_type=zone_type, **kwargs)
|
||||
changed = True
|
||||
else:
|
||||
if masters is None:
|
||||
@@ -199,9 +210,7 @@ class DnsZoneModule(OpenStackModule):
|
||||
masters, pre_update_zone)
|
||||
if changed:
|
||||
zone = self.conn.update_zone(
|
||||
name, email=email,
|
||||
description=description,
|
||||
ttl=ttl, masters=masters)
|
||||
name, **kwargs)
|
||||
|
||||
if wait:
|
||||
self._wait(timeout, zone, state)
|
||||
|
||||
Reference in New Issue
Block a user